-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-15281][table-planner-blink] Map Flink's TypeInference to Calcite's interfaces #10781
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
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit cbb7375 (Mon Jan 06 16:18:58 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
dawidwys
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Honestly I was even a bit surprised how straightforward is the mapping.
|
|
||
| public static ArgumentCount any() { | ||
| return new ConstantArgumentCount(0, OPEN_INTERVAL); | ||
| return new ConstantArgumentCount(OPEN_INTERVAL, OPEN_INTERVAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Does it make sense to have a special handling for a non present min value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will skip this change for now. I remember there was some issue while mapping to Calcite but I'm sure we will notice it when we have more tests.
| * Bridges to {@link ValueLiteralExpression#getValueAs(Class)}. | ||
| */ | ||
| @SuppressWarnings("unchecked") | ||
| protected static <T, V> T getLiteralValueAs(LiteralValueAccessor accessor, Class<T> clazz) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary V type.
| /** | ||
| * Adopted from {@link org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion}. | ||
| */ | ||
| @Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecated annotation was also adopted from Calcite. But I will remove it as it causes confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be better to remove it. Esp. as in Calcite it is actually not deprecated. There is only @SuppressWarnings("deprecation") annotation.
|
Thank you @dawidwys. I will merge this in my next batch if there are no objections. |
What is the purpose of the change
This PR connects Flink's new type inference to Calcite's type inference. It ensures that both Table API and SQL have exactly the same behavior and similar exception messages.
Note: This PR does not contain tests yet. They will be added as part of FLINK-15487 for testing end-to-end functionality.
Brief change log
SqlFunctionandSqlAggFunctionVerifying this change
Manually verified until code generation with some additional changes that will be part of FLINK-15487.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation