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

[CALCITE-6343] Fix AS alias operator stripping MEASUREness from measures #3741

Closed
wants to merge 1 commit into from

Conversation

barrkel
Copy link
Contributor

@barrkel barrkel commented Mar 26, 2024

When inferring the return type of an operator application, don't unwrap MEASURE types if the operator is an AS alias.

@barrkel barrkel force-pushed the bk-upstream-fix-as-measure-type branch 2 times, most recently from 8cd7dd4 to 622a340 Compare March 27, 2024 16:05
@YiwenWu
Copy link
Contributor

YiwenWu commented Mar 29, 2024

test failed:
image

@barrkel barrkel force-pushed the bk-upstream-fix-as-measure-type branch from 622a340 to b41526d Compare March 29, 2024 09:57
…lias operator

When inferring the return type of an operator application, don't unwrap
MEASURE types if the operator is an AS alias.
@barrkel barrkel force-pushed the bk-upstream-fix-as-measure-type branch from b41526d to 2975087 Compare March 29, 2024 10:01
@barrkel
Copy link
Contributor Author

barrkel commented Mar 29, 2024

I saw a failure with SqlXmlFunctionsTest which doesn't reproduce in the IDE and looks to be completely unrelated to my change, so I'm not sure what's going on there.

Copy link

sonarcloud bot commented Mar 29, 2024

@barrkel barrkel requested a review from tanclary March 29, 2024 14:28
if (opBinding.getOperator().kind != SqlKind.AS
&& isMeasure(returnType)
&& returnType.getMeasureElementType() != null) {
returnType = returnType.getMeasureElementType();
Copy link
Contributor

Choose a reason for hiding this comment

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

The checkerframework failure below does seem related to your change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's related to the change you asked me to make on your code, removing the not-null assertion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might need to add it back. Seems like it's messing something up.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I've found it can be a time-saver to try re-building before pushing new changes.

@mihaibudiu
Copy link
Contributor

This looks easy to fix, if you can handle the checker errors we could merge this in time for 1.38

julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Sep 16, 2024
…lias operator

When inferring the return type of an operator application, don't unwrap
MEASURE types if the operator is an AS alias.

Close apache#3741
julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Sep 16, 2024
…lias operator

When inferring the return type of an operator application, don't unwrap
MEASURE types if the operator is an AS alias.

Close apache#3741
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