bowenli86 edited a comment on issue #8920: [FLINK-13024][table] integrate FunctionCatalog with CatalogManager URL: https://github.com/apache/flink/pull/8920#issuecomment-510247248 > Thanks @bowenli86. I added some feedback. > > I think my biggest concern is how we pass input types and literals to functions. This should actually happen at a different level in the stack. For simplification, a function catalog should just lookup functions by name. The returned function definition of the factory should take care of receiving literals and input types. Since function definition does not return `TypeInference` yet, we could also use `getParameterType` and `getReturnType` of UDFs. They don't take literals but I think it is acceptable to postpone supporting this to the next release to still get this feature in before the feature freeze. @twalthr I'm a bit confused by your comment. If you've read the code and see its context, the problem I ran into is: `TableFunctionDefinition`'s constructor requires a non-null `resultType`, and `AggregateFunctionDefinition`'s constructor requires non-null `resultType` and `accumulatorType`. For Hive `GenericUDTF`, `UDAF`, `GenericUDAFResolver1/2`, we can only get the `resultType` and `accumulartorType` by initializing these Hive functions thru their wrappers with literals and input data types - please see `HiveGenericUDTF.getResultType()` and `HiveGenericUDAF.getResutType()/getAccumularType()`. I agree `FunctionDefinitionFactory` should not take literals and input data types, but due to current limitations of the Flink udf framework, I haven't found a good way to bypass it. What do you suggest to pass to constructors of `TableFunctionDefinition` and `AggregateFunctionDefinition` in `HiveFunctionDefinitionFactory#createFunctionDefinition`? A void as `BasicTypeInfo.VOID_TYPE_INFO`?
---------------------------------------------------------------- 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
