public class ClientParser extends Object implements SqlCommandParser
FlinkSqlParserImplTokenManager
to do lexical analysis. It cannot
recognize special hive keywords yet because Hive has a slightly different vocabulary compared to
Flink's, which causes the ClientParser misunderstanding some Hive's keywords to IDENTIFIER. But
the ClientParser is only responsible to check whether the statement is completed or not and only
cares about a few statements. So it's acceptable to tolerate the inaccuracy here.Constructor and Description |
---|
ClientParser() |
Modifier and Type | Method and Description |
---|---|
Optional<Operation> |
parseCommand(String command)
A dumb implementation.
|
Optional<StatementType> |
parseStatement(String statement)
Parses given statement.
|
public Optional<Operation> parseCommand(String command)
parseCommand
in interface SqlCommandParser
command
- the sql client command to evaluate.Operation
parsed. It would be empty when the command is
"" or ";".public Optional<StatementType> parseStatement(String statement) throws SqlExecutionException
SqlCommandParser
parseStatement
in interface SqlCommandParser
statement
- the sql client input to evaluate.StatementType
parsed. It would be empty when the
statement is "" or ";".SqlExecutionException
- if any error happen while parsing or validating the statement.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.