Skip to content

Extend pivot operator support #1238

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

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

iffyio
Copy link
Contributor

@iffyio iffyio commented Apr 27, 2024

Extends the parser with support for:

  • Multiple aggregate function calls
  • Aliased aggregation function calls
  • Aliased pivot values - also allowing arbitrary expressions as values

https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#pivot_operator

@coveralls
Copy link

coveralls commented Apr 27, 2024

Pull Request Test Coverage Report for Build 8897486318

Details

  • 69 of 75 (92.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 89.206%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 20 21 95.24%
tests/sqlparser_common.rs 41 46 89.13%
Totals Coverage Status
Change from base Build 8896880185: 0.01%
Covered Lines: 23842
Relevant Lines: 26727

💛 - Coveralls

#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
pub struct ExprWithAlias {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for this type - this could replace Measure from MATCH_RECOGNIZE and probably lots of other similar one-off types

@jmhain
Copy link
Contributor

jmhain commented Apr 29, 2024

looks good to me! cc @alamb

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.

LGTM -- thank you @iffyio and @jmhain

@alamb
Copy link
Contributor

alamb commented Apr 30, 2024

🤔 github says this PR has conflicts that must be resolved prior to merging

Screenshot 2024-04-30 at 9 48 39 AM

Extends the parser with support for:

- Multiple aggregate function calls
- Aliased aggregation function calls
- Aliased pivot values - also allowing arbitrary
  expressions as values

https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#pivot_operator
@iffyio iffyio force-pushed the extend-pivot-operator branch from 46bf2d7 to 8dfe4f5 Compare April 30, 2024 15:27
@iffyio
Copy link
Contributor Author

iffyio commented Apr 30, 2024

Resolved conflicts
thanks for the reviews @alamb @jmhain!

@alamb alamb merged commit 8626051 into apache:main Apr 30, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Apr 30, 2024

Thanks again

@iffyio iffyio deleted the extend-pivot-operator branch April 30, 2024 19:50
JichaoS pushed a commit to luabase/sqlparser-rs that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants