Skip to content

Conversation

@comphead
Copy link
Contributor

Which issue does this PR close?

Closes #2697 .

Rationale for this change

Improve readability for Table scans. Provide column name instead of column index.

TableScan a projection=[col1,col2] instead of TableScan a projection=Some([col1,col2])

What changes are included in this PR?

Are there any user-facing changes?

comphead added 2 commits June 24, 2022 14:23
…tion-readability-merged

# Conflicts:
#	datafusion/core/src/logical_plan/plan.rs
#	datafusion/core/src/optimizer/limit_push_down.rs
#	datafusion/core/tests/custom_sources.rs
#	datafusion/core/tests/sql/avro.rs
#	datafusion/core/tests/sql/explain_analyze.rs
#	datafusion/core/tests/sql/json.rs
#	datafusion/core/tests/sql/projection.rs
#	datafusion/core/tests/sql/udf.rs
#	datafusion/core/tests/user_defined_plan.rs
#	datafusion/expr/src/logical_plan/builder.rs
#	datafusion/expr/src/logical_plan/plan.rs
#	datafusion/optimizer/src/filter_push_down.rs
#	datafusion/optimizer/src/projection_push_down.rs
#	datafusion/optimizer/src/single_distinct_to_groupby.rs
#	datafusion/sql/src/planner.rs
@github-actions github-actions bot added core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules sql SQL Planner labels Jun 24, 2022
@comphead
Copy link
Contributor Author

@andygrove my concern however the output like

        "  Projection: #aggregate_test_100.c1",
        "    Filter: #aggregate_test_100.c2 > Int64(10)",
        "      TableScan: aggregate_test_100 projection=[c1, c2], 

Afaik Projection here is query projection(selected by user output), and TableScan projection is what needs to be fetched from the table to make query work. Since both of it named as projection won't be that confusing?

@comphead
Copy link
Contributor Author

@codecov-commenter
Copy link

Codecov Report

Merging #2789 (f76c5b5) into master (fed2045) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2789      +/-   ##
==========================================
- Coverage   85.14%   85.11%   -0.04%     
==========================================
  Files         273      273              
  Lines       48248    48241       -7     
==========================================
- Hits        41079    41058      -21     
- Misses       7169     7183      +14     
Impacted Files Coverage Δ
datafusion/core/src/datasource/view.rs 86.60% <ø> (ø)
datafusion/core/tests/custom_sources.rs 83.72% <ø> (ø)
datafusion/core/tests/sql/explain_analyze.rs 82.28% <ø> (ø)
datafusion/core/tests/sql/joins.rs 99.10% <ø> (ø)
datafusion/core/tests/sql/json.rs 46.87% <ø> (ø)
datafusion/core/tests/sql/projection.rs 96.36% <ø> (ø)
datafusion/core/tests/sql/udf.rs 100.00% <ø> (ø)
datafusion/core/tests/user_defined_plan.rs 87.79% <ø> (ø)
datafusion/expr/src/logical_plan/builder.rs 89.51% <ø> (ø)
...tafusion/optimizer/src/common_subexpr_eliminate.rs 94.11% <ø> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fed2045...f76c5b5. Read the comment docs.

@comphead comphead marked this pull request as ready for review June 27, 2022 16:26
@comphead
Copy link
Contributor Author

@andygrove please check this

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @comphead -- I think the plans now look much nicer 🧹 👍

@alamb alamb changed the title Improve readability of table scan projections in query plans Improve readability of table scan projections in query plans (remove Some and None) Jun 27, 2022
@alamb alamb merged commit 533e2b4 into apache:master Jun 27, 2022
@comphead comphead deleted the tablescan-projection-readability-merged branch September 8, 2022 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve readability of table scan projections in query plans

3 participants