Search in sources :

Example 1 with FlinkCalciteSqlValidator

use of org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator in project flink by apache.

the class TypeInferenceReturnInference method extractExpectedOutputType.

// --------------------------------------------------------------------------------------------
@Nullable
private RelDataType extractExpectedOutputType(SqlOperatorBinding opBinding) {
    if (opBinding instanceof SqlCallBinding) {
        final SqlCallBinding binding = (SqlCallBinding) opBinding;
        final FlinkCalciteSqlValidator validator = (FlinkCalciteSqlValidator) binding.getValidator();
        return validator.getExpectedOutputType(binding.getCall()).orElse(null);
    }
    return null;
}
Also used : SqlCallBinding(org.apache.calcite.sql.SqlCallBinding) FlinkCalciteSqlValidator(org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 SqlCallBinding (org.apache.calcite.sql.SqlCallBinding)1 FlinkCalciteSqlValidator (org.apache.flink.table.planner.calcite.FlinkCalciteSqlValidator)1