snuyanzin commented on code in PR #28975:
URL: https://github.com/apache/flink/pull/28975#discussion_r3784365520
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestUtils.java:
##########
@@ -1188,6 +1189,36 @@ public void eval(@ArgumentHint(ROW_SEMANTIC_TABLE)
CastingPojo p, long b) {
}
}
+ /**
+ * Testing function whose table argument declares a non-default conversion
class ({@link
+ * RowData}). The conversion class must be preserved so that {@code
eval()} receives {@link
+ * RowData} instead of {@link Row}.
+ */
+ public static class RowDataRowSemanticTableFunction extends
AppendProcessTableFunctionBase {
+ public TypeInference getTypeInference(DataTypeFactory typeFactory) {
+ return TypeInference.newBuilder()
+ .staticArguments(
+ StaticArgument.table(
+ "input",
+ RowData.class,
+ false,
+
EnumSet.of(StaticArgumentTrait.ROW_SEMANTIC_TABLE)))
+ .outputTypeStrategy(
+ callContext ->
+ Optional.of(
+ DataTypes.ROW(
+ DataTypes.FIELD(
+ "out",
+
DataTypes.STRING().notNull()))
+ .notNull()))
+ .build();
+ }
Review Comment:
yep, makes sense, done
thank you
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]