Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #110 support group by column positions #519

Merged
merged 5 commits into from
Jun 8, 2021

Conversation

jychen7
Copy link
Contributor

@jychen7 jychen7 commented Jun 6, 2021

Which issue does this PR close?

Closes #110

What changes are included in this PR?

similar to extract and resolve alias, we create new functions to extract and resolve positions
(note: alias is resolve recursively, but position is resolve as a whole)

Are there any user-facing changes?

no

@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2021

Codecov Report

Merging #519 (c86c061) into master (b84789a) will decrease coverage by 0.00%.
The diff coverage is 79.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #519      +/-   ##
==========================================
- Coverage   76.09%   76.08%   -0.01%     
==========================================
  Files         155      157       +2     
  Lines       26575    26901     +326     
==========================================
+ Hits        20221    20468     +247     
- Misses       6354     6433      +79     
Impacted Files Coverage Δ
datafusion-cli/src/lib.rs 0.00% <0.00%> (ø)
datafusion-cli/src/main.rs 0.00% <0.00%> (ø)
datafusion/src/sql/planner.rs 84.51% <90.90%> (+0.25%) ⬆️
datafusion/src/sql/utils.rs 67.61% <100.00%> (+0.82%) ⬆️
datafusion/src/physical_plan/windows.rs 86.22% <0.00%> (-0.91%) ⬇️
...lista/rust/core/src/serde/logical_plan/to_proto.rs 61.64% <0.00%> (-0.77%) ⬇️
...sta/rust/core/src/serde/logical_plan/from_proto.rs 35.41% <0.00%> (-0.51%) ⬇️
datafusion/src/optimizer/utils.rs 48.05% <0.00%> (-0.18%) ⬇️
...ta/rust/core/src/serde/physical_plan/from_proto.rs 38.51% <0.00%> (-0.14%) ⬇️
... and 7 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 ee2b9ef...c86c061. Read the comment docs.

datafusion/src/sql/utils.rs Outdated Show resolved Hide resolved
datafusion/src/sql/utils.rs Outdated Show resolved Hide resolved
datafusion/src/sql/utils.rs Outdated Show resolved Hide resolved
datafusion/src/sql/utils.rs Outdated Show resolved Hide resolved
@alamb alamb added the datafusion Changes in the datafusion crate label Jun 7, 2021
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.

This is looking good @jychen7 -- thank you for the contribution 👍 A few more tests and it will be good to go from my perspective

datafusion/src/sql/planner.rs Outdated Show resolved Hide resolved
datafusion/src/sql/utils.rs Outdated Show resolved Hide resolved
datafusion/src/sql/utils.rs Show resolved Hide resolved
@jychen7 jychen7 requested review from Dandandan and alamb June 8, 2021 00:44
\n TableScan: person projection=None",
);
quick_test(
"SELECT state, age AS b, COUNT(1) FROM person GROUP BY 2, 1",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

Looks great to me @jychen7 -- thank you so much!

@alamb alamb merged commit e39f311 into apache:master Jun 8, 2021
@houqp houqp changed the title 110 support group by positions support group by column positions Jul 31, 2021
@houqp houqp added enhancement New feature or request sql SQL Planner labels Jul 31, 2021
@jychen7 jychen7 deleted the 110-group-by-position branch February 13, 2022 18:11
@jychen7 jychen7 changed the title support group by column positions #100 support group by column positions Mar 27, 2022
@jychen7 jychen7 changed the title #100 support group by column positions #110 support group by column positions Mar 27, 2022
@jychen7 jychen7 changed the title #110 support group by column positions feat: #110 support group by column positions Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate enhancement New feature or request sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grouping by column position
5 participants