[SPARK-48660][SQL] Fix explain result for CreateTableAsSelect
What changes were proposed in this pull request?
To fix the explain result of 'CreateTableAsSelect', according to how ExplainCommand processes, I find out the following work is needed
- CreateDataSourceTableAsSelectCommand should implement stats
- ExecutedCommandExec should also implement innerChildren for CreateDataSourceTableAsSelectCommand
Here's why:
- As to 'CREATE TABLE ... AS SELECT'
- CreateDataSourceTableAsSelectCommand will finally be the LogicPlan
- ExecutedCommandExec(cmd=CreateDataSourceTableAsSelectCommand) will finally be the PhysicalPlan
Thus , to have the expected output
- CreateDataSourceTableAsSelectCommand adds stats implementation
- ExecutedCommandExec adds innerChildren for QueryExecution.stringWithStats
Why are the changes needed?
as reported in SPARK-48660, explain result of 'CreateTableAsSelect' is incorrect. It's missing stats for logic plan and optimization for physical plan.
Does this PR introduce any user-facing change?
Yes, it affects the explain result.
How was this patch tested?
UT.
Was this patch authored or co-authored using generative AI tooling?
No
cc @wangyum FYI
Could you fix the failed tests first? @yuexing
The result seems correct. Do you have time to review this one? @wangyum
friendly ping @wangyum
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!