[python] Add 'paimon table explain' CLI command#7896
Open
TheR1sing3un wants to merge 2 commits into
Open
Conversation
Surface ReadBuilder.explain() through the CLI so users can inspect a scan plan without writing Python. Supports --where / --select / --limit / --verbose / --format table|json, mirroring 'table read'. Unlike 'table read', --limit is always pushed down (the point of explain is to reveal what the planner sees, including limit pushdown). Removes the follow-up TODO next to ReadBuilder.explain. Docs go to cli.md and python-api.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
paimon table explain <db.tbl>CLI subcommand exposingReadBuilder.explain()(#7869). Supports--where,--select,--limit,--verbose,--format table|json, mirroringpaimon table read. Follow-up of #7869 — also removes the CLI TODO left next toReadBuilder.explain.Sample output
paimon -c paimon.yaml table explain default.events --where "dt='2026-05-16' AND id=7" --select dt,id,val:--format jsonis also available for scripting (withlevel_histogramkeys as JSON strings).Tests
pypaimon/tests/cli_table_test.pyadds 7 cases: baseline,--select+--limit,--verbose, partition pruning via--where, JSON format, invalid table, invalid WHERE. Full pypaimon CLI + explain suite is clean locally.Docs
docs/content/pypaimon/cli.md— new### Table Explainsectiondocs/content/pypaimon/python-api.md— CLI block under existing "Explain Scan Plan" subsectionGenerative AI usage
Drafted with the help of Claude Code; reviewed and tested locally by the author.