Interface Parser
@PublicEvolving
public interface Parser
Provides methods for parsing SQL objects from a SQL string.
-
Method Summary
Modifier and TypeMethodDescriptionString[]getCompletionHints(String statement, int position) Returns completion hints for the given statement at the given cursor position.Entry point for parsing SQL queries expressed as a String.org.apache.flink.table.catalog.UnresolvedIdentifierparseIdentifier(String identifier) Entry point for parsing SQL identifiers expressed as a String.org.apache.flink.table.expressions.ResolvedExpressionparseSqlExpression(String sqlExpression, org.apache.flink.table.types.logical.RowType inputRowType, org.apache.flink.table.types.logical.LogicalType outputType) Entry point for parsing SQL expressions expressed as a String.
-
Method Details
-
parse
Entry point for parsing SQL queries expressed as a String.Note:If the created
Operationis aQueryOperationit must be in a form that will be understood by thePlanner.translate(List)method.The produced Operation trees should already be validated.
- Parameters:
statement- the SQL statement to evaluate- Returns:
- parsed queries as trees of relational
Operations - Throws:
SqlParserException- when failed to parse the statement
-
parseIdentifier
Entry point for parsing SQL identifiers expressed as a String.- Parameters:
identifier- the SQL identifier to parse- Returns:
- parsed identifier
- Throws:
SqlParserException- when failed to parse the identifier
-
parseSqlExpression
org.apache.flink.table.expressions.ResolvedExpression parseSqlExpression(String sqlExpression, org.apache.flink.table.types.logical.RowType inputRowType, @Nullable org.apache.flink.table.types.logical.LogicalType outputType) Entry point for parsing SQL expressions expressed as a String.- Parameters:
sqlExpression- the SQL expression to parseinputRowType- the fields available in the SQL expressionoutputType- expected top-level output type if available- Returns:
- resolved expression
- Throws:
SqlParserException- when failed to parse the sql expression
-
getCompletionHints
Returns completion hints for the given statement at the given cursor position. The completion happens case insensitively.- Parameters:
statement- Partial or slightly incorrect SQL statementposition- cursor position- Returns:
- completion hints that fit at the current cursor position
-