@Internal public interface Parser
Modifier and Type | Method and Description |
---|---|
String[] |
getCompletionHints(String statement,
int position)
Returns completion hints for the given statement at the given cursor position.
|
List<Operation> |
parse(String statement)
Entry point for parsing SQL queries expressed as a String.
|
UnresolvedIdentifier |
parseIdentifier(String identifier)
Entry point for parsing SQL identifiers expressed as a String.
|
ResolvedExpression |
parseSqlExpression(String sqlExpression,
RowType inputRowType,
LogicalType outputType)
Entry point for parsing SQL expressions expressed as a String.
|
List<Operation> parse(String statement)
Note:If the created Operation
is a QueryOperation
it must be in a
form that will be understood by the Planner.translate(List)
method.
The produced Operation trees should already be validated.
statement
- the SQL statement to evaluateOperation
sSqlParserException
- when failed to parse the statementUnresolvedIdentifier parseIdentifier(String identifier)
identifier
- the SQL identifier to parseSqlParserException
- when failed to parse the identifierResolvedExpression parseSqlExpression(String sqlExpression, RowType inputRowType, @Nullable LogicalType outputType)
sqlExpression
- the SQL expression to parseinputRowType
- the fields available in the SQL expressionoutputType
- expected top-level output type if availableSqlParserException
- when failed to parse the sql expressionString[] getCompletionHints(String statement, int position)
statement
- Partial or slightly incorrect SQL statementposition
- cursor positionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.