...
<T> Optional<T> getArgumentValue(int pos, Class<T> clazz);
/**
* Returns the set of usages in this context.
*/
default Set<ContextUsage> getUsages() {
return Collections.emptySet();
}
/**
* Return whether a function in an aggregate query with grouping columnsReturns the function's name usually referencing the function in a catalog.
*
* @return Returns true if the number of grouping columns greater than zero.
* The other cases will return false.
*/
<p>Note: The name is meant for debugging purposes only.
*/
String getName();
}
/**
* Provides details about the function call for {@link InputTypeValidator} and {@link TypeStrategy}.
*/
@PublicEvolving
public interface CallContext extends CallContextBase { boolean hasGrouping();
/**
* Returns a resolved list of the functioncall's name usually referencing the function in a catalog.
*
argument types. It also includes a type for every argument
* in a vararg function call * <p>Note: The name is meant for debugging purposes only.
*/
String getNameList<DataType> getArgumentDataTypes();
}
/**
* Provides details about the function call for Characteristics that a {@link InputTypeValidator} and {@link TypeStrategy}.
*/
@PublicEvolving
CallContextBase} use.
*/
public enum ContextUsage {
/**
* Using grouping columns for aggregation, indicate the grouping size is greater than zero.
*/
GROUPING_AGGREGATION,public interface CallContext extends CallContextBase {
/**
* Returns a resolved list of the call's argument types. It also includes a type for every argument * in a vararg function callIndicate the function is an aggregate function with a filter.
*/
List<DataType> getArgumentDataTypes();FILTERING_AGGREGATION
}
Introduce InputTypeStrategy
...
- Complete BuiltInFunctionDefinition and FunctionDefinition
- add standardSql field
- add isDeterministic field
- add monotonicity field
- add InputTypeStrategy to type inference
- CallContext support hasGroupingsupport ContextUsage.GROUPING_AGGREGATION
- Introduce wrappers
- Introduce SqlOperandTypeCheckerWrapper
- Introduce SqlReturnTypeInferenceWrapper
- Introduce SqlOperandTypeInferenceWrapper
- Introduce SqlFunctionWrapper
- Introduce ExpressionConverter (If no type inference implementation for function, still do PlannerExpression way)
- Support that standardSql field, directly convert to SqlFunction of SqlStdOperatorTable
- Support SqlFunctionWrapper
- Use new Expression in RexNodeToExpressionConverter instead of PlannerExpression. (for remove PlannerExpressions)
- Start rework BuiltInFunctionDefinitions, With the judge of ResolveCallByArgumentsRule and ExpressionConverter. (definition.getTypeInference().getOutputTypeStrategy() != TypeStrategies.MISSING), we can implement FunctionDefinition one by one and drop PlannerExpressions one by one.
- Introduce TypeStrategies: CascadeTypeStrategy, ExplicitTypeStrategy, OrdinalTypeStrategy, ChainTypeStrategy
- Introduce TypeTransformations: ToNullableTransformation, FORCE_NULLABLE, TO_VARYING
- Introduce InputTypeStrategies: FIRST_KNOWN, OUTPUT_TYPE, BOOLEAN
- Introduce InputTypeValidators: CompositeTypeValidator, AnyTypeValidator, PassingTypeValidator, TypeFamilyTypeValidator, TypeRootTypeValidator, SameTypeValidator.
- Implement type inference for logic functions. And introduce a testing infrastructure to verify flink type inference and calcite type inference.
- Implement type inference for string functions.
- Implement type inference for math functions.
- Implement type inference for time functions.
- Implement type inference for other functions.
- Drop PlannerExpressions one by one.
- Apply things in blink-planner and add blink-planner extended functions
...