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));
}
}
Aggregations