You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/06/01 13:09:45 UTC
[GitHub] [flink] Airblader commented on a change in pull request #16020: [FLINK-21911][table-api] Add built-in greatest/least functions support #15821
Airblader commented on a change in pull request #16020:
URL: https://github.com/apache/flink/pull/16020#discussion_r643083312
##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/TypeStrategies.java
##########
@@ -419,6 +420,17 @@ public static TypeStrategy varyingString(TypeStrategy initialStrategy) {
return Optional.of(nullReplacementDataType);
};
+ /** Type strategy specific for greatest and least. */
+ public static final TypeStrategy GREATEST_LEAST =
Review comment:
I believe this is the same as `TypeStrategies.COMMON`, isn't it? In that case we don't need a separate strategy.
##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/expressions/converter/DirectConvertRule.java
##########
@@ -160,6 +160,9 @@
DEFINITION_OPERATOR_MAP.put(BuiltInFunctionDefinitions.HEX, FlinkSqlOperatorTable.HEX);
DEFINITION_OPERATOR_MAP.put(
BuiltInFunctionDefinitions.TRUNCATE, FlinkSqlOperatorTable.TRUNCATE);
+ DEFINITION_OPERATOR_MAP.put(
Review comment:
Implementing the functions here and in `FlinkSqlOperatorTable` duplicates their type strategy information from the new function stack. We can avoid that by not adding this in those two places, however it requires https://github.com/apache/flink/pull/16046 (something I discussed with @twalthr). It would be nice, though, to not duplicate the type signatures for these functions and implementing them in both the old and new stack.
Ideally we'd even implement GREATEST and LEAST entirely on the new stack, but I think this isn't yet possible, so going through code generation should be fine for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org