Skip to content

[CALCITE-4176] Key descriptor can be optional in SESSION table function#2164

Merged
amaliujia merged 1 commit intoapache:masterfrom
liupc:CALCITE-4176
Sep 27, 2020
Merged

[CALCITE-4176] Key descriptor can be optional in SESSION table function#2164
amaliujia merged 1 commit intoapache:masterfrom
liupc:CALCITE-4176

Conversation

@liupc
Copy link
Copy Markdown
Contributor

@liupc liupc commented Sep 22, 2020

This PR try to make the key descriptor optional in SESSION table function

  • Handling the optional key descriptor when checking operand types
  • Add validation and checks for operands of time column descriptor

@liupc
Copy link
Copy Markdown
Contributor Author

liupc commented Sep 22, 2020

cc @amaliujia @danny0405

@amaliujia
Copy link
Copy Markdown
Contributor

amaliujia commented Sep 23, 2020

@liupc please let me know when this PR is ready for review.

@liupc
Copy link
Copy Markdown
Contributor Author

liupc commented Sep 23, 2020

@amaliujia It's ready now! One thing may need to consider, we may also need to rework the implementation for the session window table to allow optional key column descriptor, but I prefer to open another jira/PR for it, what do you think?

@amaliujia
Copy link
Copy Markdown
Contributor

@liupc

Thanks, I will take a look this week.

yes I think for the enumerable implementation that can be updated in another PR.

Comment thread core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
Comment thread core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
return throwValidationSignatureErrorOrReturnFalse(callBinding, throwOnFailure);
}
if (!checkTimeColumnDescriptorOperand(callBinding, 1)) {
return throwValidationSignatureErrorOrReturnFalse(callBinding, throwOnFailure);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why need this addition (as this PR is to change SESSION)? is there a test case verify this line of change?

Copy link
Copy Markdown
Contributor Author

@liupc liupc Sep 24, 2020

Choose a reason for hiding this comment

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

For TUMBLE/HOP table function, the descriptor must refer to a time column, I just add this check by the way.
currently, there are no tests to verify this change, but If it's ok to do it in this PR, I can add some tests for it.
Or maybe we can put it in another PR? what's your idea?

Copy link
Copy Markdown
Contributor

@amaliujia amaliujia Sep 24, 2020

Choose a reason for hiding this comment

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

I see. Please add tests to this PR (for both TUMBLE and HOP) and we can merge it together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@amaliujia
Copy link
Copy Markdown
Contributor

+1

@amaliujia amaliujia added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Sep 25, 2020
@amaliujia
Copy link
Copy Markdown
Contributor

@liupc would you mind squashing your commits into one so I can merge this PR?

Fix style

Fix style

Adding tests to check time column for TUMBLE/HOP table function

Fix style
@liupc
Copy link
Copy Markdown
Contributor Author

liupc commented Sep 27, 2020

hi @amaliujia , It's done!

@amaliujia amaliujia merged commit d701495 into apache:master Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants