Xinglong Wang created FLINK-36152:
-------------------------------------
Summary: Traverse through the superclass hierarchy to extract
generic type.
Key: FLINK-36152
URL: https://issues.apache.org/jira/browse/FLINK-36152
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Affects Versions: 1.16.1, 2.0.0
Reporter: Xinglong Wang
In our case, there's a `ConcreteLookupFunction extends AbstractLookupFunction`,
and `AbstractLookupFunction extends TableFunction<RowData>`.
However `Class#getGenericSuperclass` only return the direct superclass, so it
cannot extract the correct generic type `RowData`.
I can reproduce the exception below:
{code:java}
//
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/sql/FunctionITCase.java
@Test
void testLookupTableFunctionWithoutHintLevel2()
throws ExecutionException, InterruptedException {
testLookupTableFunctionBase(LookupTableWithoutHintLevel2Function.class.getName());
}
// ... ...
public static class LookupTableWithoutHintLevel2Function
extends LookupTableWithoutHintLevel1Function {}{code}
{code:java}
org.apache.flink.table.api.ValidationException: Cannot extract a data type from
an internal 'org.apache.flink.table.data.RowData' class without further
information. Please use annotations to define the full logical type.
at
org.apache.flink.table.types.extraction.ExtractionUtils.extractionError(ExtractionUtils.java:424)
at
org.apache.flink.table.types.extraction.ExtractionUtils.extractionError(ExtractionUtils.java:419)
at
org.apache.flink.table.types.extraction.DataTypeExtractor.checkForCommonErrors(DataTypeExtractor.java:425)
at
org.apache.flink.table.types.extraction.DataTypeExtractor.extractDataTypeOrError(DataTypeExtractor.java:330)
at
org.apache.flink.table.types.extraction.DataTypeExtractor.extractDataTypeOrRawWithTemplate(DataTypeExtractor.java:290)
... 53 more
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)