snuyanzin commented on code in PR #28065:
URL: https://github.com/apache/flink/pull/28065#discussion_r3160731765
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestUtils.java:
##########
@@ -1207,4 +1207,43 @@ public String toString() {
private static String toModeSummary(ChangelogMode mode) {
return MODE_SUMMARY.get(mode.toString());
}
+
+ /**
+ * Test PTF that declares {@link StaticArgumentTrait#NO_PASS_THROUGH} on
its single table
+ * argument by overriding {@link #getTypeInference}. With this trait, the
framework prepends no
+ * partition-key prefix and appends no system rowtime - the function emits
its declared output
+ * verbatim.
+ *
+ * <p>{@link ArgumentTrait} does not yet expose {@code NO_PASS_THROUGH} to
user PTFs, so the
+ * declaration goes through the underlying {@link StaticArgument} API.
+ */
+ public static class NoPassThroughFunction extends
ProcessTableFunction<Row> {
+
+ public void eval(Context ctx, Row input) {
+ collect(input);
+ }
+
+ @Override
+ public TypeInference getTypeInference(DataTypeFactory typeFactory) {
+ return TypeInference.newBuilder()
+ .staticArguments(
+ StaticArgument.table(
+ "input",
+ Row.class,
+ false,
+ EnumSet.of(
+ StaticArgumentTrait.TABLE,
+
StaticArgumentTrait.SET_SEMANTIC_TABLE,
+
StaticArgumentTrait.NO_PASS_THROUGH)))
+ .outputTypeStrategy(
+ callContext ->
+ Optional.of(
+ callContext
+ .getTableSemantics(0)
+
.orElseThrow(IllegalStateException::new)
+ .dataType()
+ .notNull()))
Review Comment:
how about extraction into a separate var to reduce formatting
--
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]