Search in sources :

Example 1 with ScalarSqlFunction

use of org.apache.flink.table.planner.functions.utils.ScalarSqlFunction in project flink by apache.

the class RexNodeJsonSerializer method serializeSqlOperator.

// --------------------------------------------------------------------------------------------
/**
 * Logic shared with {@link AggregateCallJsonSerializer}.
 */
static void serializeSqlOperator(SqlOperator operator, JsonGenerator gen, SerializerProvider serializerProvider, boolean serializeCatalogObjects) throws IOException {
    if (operator.getSyntax() != SqlSyntax.FUNCTION) {
        gen.writeStringField(FIELD_NAME_SYNTAX, calciteToSerializable(operator.getSyntax()).getValue());
    }
    if (operator instanceof BridgingSqlFunction) {
        final BridgingSqlFunction function = (BridgingSqlFunction) operator;
        serializeBridgingSqlFunction(function.getName(), function.getResolvedFunction(), gen, serializerProvider, serializeCatalogObjects);
    } else if (operator instanceof BridgingSqlAggFunction) {
        final BridgingSqlAggFunction function = (BridgingSqlAggFunction) operator;
        serializeBridgingSqlFunction(function.getName(), function.getResolvedFunction(), gen, serializerProvider, serializeCatalogObjects);
    } else if (operator instanceof ScalarSqlFunction || operator instanceof TableSqlFunction || operator instanceof AggSqlFunction) {
        throw legacyException(operator.toString());
    } else {
        // We assume that all regular SqlOperators are internal. Only the function definitions
        // stack is exposed to the user and can thus be external.
        gen.writeStringField(FIELD_NAME_INTERNAL_NAME, BuiltInSqlOperator.toQualifiedName(operator));
    }
}
Also used : ScalarSqlFunction(org.apache.flink.table.planner.functions.utils.ScalarSqlFunction) TableSqlFunction(org.apache.flink.table.planner.functions.utils.TableSqlFunction) BridgingSqlFunction(org.apache.flink.table.planner.functions.bridging.BridgingSqlFunction) BridgingSqlAggFunction(org.apache.flink.table.planner.functions.bridging.BridgingSqlAggFunction) AggSqlFunction(org.apache.flink.table.planner.functions.utils.AggSqlFunction)

Aggregations

BridgingSqlAggFunction (org.apache.flink.table.planner.functions.bridging.BridgingSqlAggFunction)1 BridgingSqlFunction (org.apache.flink.table.planner.functions.bridging.BridgingSqlFunction)1 AggSqlFunction (org.apache.flink.table.planner.functions.utils.AggSqlFunction)1 ScalarSqlFunction (org.apache.flink.table.planner.functions.utils.ScalarSqlFunction)1 TableSqlFunction (org.apache.flink.table.planner.functions.utils.TableSqlFunction)1