KurtYoung commented on a change in pull request #9089:
[FLINK-13225][table-planner-blink] Introduce type inference for hive functions
in blink
URL: https://github.com/apache/flink/pull/9089#discussion_r311338752
##########
File path:
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/catalog/FunctionCatalogOperatorTable.java
##########
@@ -90,13 +100,45 @@ private boolean isNotUserFunction(SqlFunctionCategory
category) {
String name,
FunctionDefinition functionDefinition) {
if (functionDefinition instanceof AggregateFunctionDefinition) {
- return convertAggregateFunction(name,
(AggregateFunctionDefinition) functionDefinition);
+ AggregateFunctionDefinition def =
(AggregateFunctionDefinition) functionDefinition;
+ if (isHiveFunc(def.getAggregateFunction())) {
+ return Optional.of(new HiveAggSqlFunction(
+ name,
+ name,
+ def.getAggregateFunction(),
+ typeFactory));
+ } else {
+ return convertAggregateFunction(name,
(AggregateFunctionDefinition) functionDefinition);
+ }
} else if (functionDefinition instanceof
ScalarFunctionDefinition) {
- return convertScalarFunction(name,
(ScalarFunctionDefinition) functionDefinition);
+ ScalarFunctionDefinition def =
(ScalarFunctionDefinition) functionDefinition;
+ if (isHiveFunc(def.getScalarFunction())) {
+ return Optional.of(new HiveScalarSqlFunction(
+ name,
+ name,
+ def.getScalarFunction(),
+ typeFactory));
+ } else {
+ return convertScalarFunction(name, def);
+ }
} else if (functionDefinition instanceof
TableFunctionDefinition &&
category != null &&
category.isTableFunction()) {
- return convertTableFunction(name,
(TableFunctionDefinition) functionDefinition);
+ TableFunctionDefinition def = (TableFunctionDefinition)
functionDefinition;
+ if (isHiveFunc(def.getTableFunction())) {
+ DataType returnType =
fromLegacyInfoToDataType(new GenericTypeInfo<>(Row.class));
+ // it is a hive function
Review comment:
unnecessary comment
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services