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

[BEAM-9514] For aggregate return type, use Calcite type inference ins… #14392

Closed
wants to merge 3 commits into from

Conversation

ibzib
Copy link
Contributor

@ibzib ibzib commented Mar 31, 2021

…tead of ZetaSQL.

ZetaSQL does not know the nullability of the return type, but the operator should.

The previous approach was to make outputs nullable if inputs were nullable, which is not generally correct.

R: @apilloud


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.
  • Update CHANGES.md with noteworthy changes.
  • 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 ULR Dataflow Flink Samza Spark Twister2
Go --- --- 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
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 --- Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
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.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

…tead of ZetaSQL.

ZetaSQL does not know the nullability of the return type, but the operator should.

The previous approach was to make outputs nullable if inputs were nullable, which is not generally correct.
Copy link
Member

@apilloud apilloud left a comment

Choose a reason for hiding this comment

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

LGTM

@apilloud
Copy link
Member

Are there tests we can turn on to make sure this doesn't regress? (Or followup CLs we can merge?

@ibzib
Copy link
Contributor Author

ibzib commented Mar 31, 2021

Are there tests we can turn on to make sure this doesn't regress? (Or followup CLs we can merge?

LOGICAL_AND is an example of a function that did not conform to the previous assumption. But it will require more work before we can merge it (#13817).

@ibzib
Copy link
Contributor Author

ibzib commented Apr 2, 2021

I ran compliance tests on this, and some aggregate function tests are failing. For example, one such test expects an error. It was listed as ALLOW_ERROR before, and was giving this error:

java.lang.AssertionError: type mismatch:
aggCall type:
BIGINT NOT NULL
inferred type:
BIGINT

But now it does not throw any error, and instead returns a result, which is incorrect.

So in summary, this PR fixes one problem, which reveals several other unrelated problems.

These are all of the failures unmasked by fixing aggregate output nullability. Previously these queries would fail in translation because of BEAM-9514.
@ibzib
Copy link
Contributor Author

ibzib commented Apr 5, 2021

I added a bunch of tests for the bugs this fix uncovers.

@ibzib
Copy link
Contributor Author

ibzib commented Apr 6, 2021

Closing this for now because it is blocked by those other bugs (BEAM-10379, BEAM-12098, BEAM-12099, BEAM-12100).

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.

None yet

2 participants