use of org.apache.flink.table.planner.calcite.SqlExprToRexConverter in project flink by apache.
the class ParserImpl method parseSqlExpression.
@Override
public ResolvedExpression parseSqlExpression(String sqlExpression, RowType inputRowType, @Nullable LogicalType outputType) {
final SqlExprToRexConverter sqlExprToRexConverter = sqlExprToRexConverterFactory.create(inputRowType, outputType);
final RexNode rexNode = sqlExprToRexConverter.convertToRexNode(sqlExpression);
final LogicalType logicalType = FlinkTypeFactory.toLogicalType(rexNode.getType());
// expand expression for serializable expression strings similar to views
final String sqlExpressionExpanded = sqlExprToRexConverter.expand(sqlExpression);
return new RexNodeExpression(rexNode, TypeConversions.fromLogicalToDataType(logicalType), sqlExpression, sqlExpressionExpanded);
}
Aggregations