Skip to content

[BEAM-9027] Unparse DOY/DOW/WEEK Enums properly for ZetaSQL#10539

Merged
apilloud merged 1 commit intoapache:masterfrom
apilloud:enum
Jan 10, 2020
Merged

[BEAM-9027] Unparse DOY/DOW/WEEK Enums properly for ZetaSQL#10539
apilloud merged 1 commit intoapache:masterfrom
apilloud:enum

Conversation

@apilloud
Copy link
Member

@apilloud apilloud commented Jan 8, 2020

Fixes enums for unparsing, passes compliance tests with ZetaSQL Calc. Unit tests aren't possible because of mismatches of these types being 0 or 1 indexed.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@apilloud
Copy link
Member Author

apilloud commented Jan 8, 2020

R: @robinyqiu
cc: @amaliujia

Copy link
Contributor

@robinyqiu robinyqiu left a comment

Choose a reason for hiding this comment

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

LGTM after a quick review, but I am not sure I have enough context of how unparsing works.

@11moon11 do you have time to take another look?


/** Only sample scenarios are covered here. Excessive testing is done via Compliance tests. */
@Test
@Ignore("ZetaSQL does not support EnumType to IdentifierLiteral")
Copy link
Contributor

Choose a reason for hiding this comment

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

How could this test pass without running BeamZetaSqlCalcRel? My understanding is that the changes in this PR is only used in BeamZetaSqlCalcRel. Is this not correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

BigQuery predicate push-down also makes use of the unparsing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could pass because ZetaSQL somehow starts to support EnumType.

Copy link
Member Author

Choose a reason for hiding this comment

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

Limited support for EnumType was added but the tests weren't turned on.

@11moon11
Copy link
Contributor

11moon11 commented Jan 10, 2020

LGTM.

mismatches of these types being 0 or 1 indexed.

Is there anything we can do (short/long term) to workaround/fix it?

@apilloud
Copy link
Member Author

For the offset by 0 or 1 issue we need to do some work to make it configurable in Calcite. There is probably a workaround but it isn't worth investing in at the moment.

@apilloud apilloud merged commit 909c543 into apache:master Jan 10, 2020
@apilloud apilloud deleted the enum branch January 10, 2020 23:12
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