Timo Walther created FLINK-37651:
------------------------------------

             Summary: Simplify StaticArgument builders for easier type inference
                 Key: FLINK-37651
                 URL: https://issues.apache.org/jira/browse/FLINK-37651
             Project: Flink
          Issue Type: Sub-task
          Components: Table SQL / API
            Reporter: Timo Walther
            Assignee: Timo Walther


Implementing type strategies in PTFs needs to become easier.
Currently this code is needed if input == output:
{code}
@Override
        public TypeInference getTypeInference(DataTypeFactory typeFactory) {
            return TypeInference.newBuilder()
                    .staticArguments(
                            StaticArgument.table(
                                    "input",
                                    Row.class,
                                    false,
                                    
EnumSet.of(StaticArgumentTrait.TABLE_AS_SET)))
                    .outputTypeStrategy(
                            callContext -> 
Optional.of(callContext.getArgumentDataTypes().get(0)))
                    .build();
        }
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to