Package org.apache.calcite.sql.advise
Class SqlSimpleParser
java.lang.Object
org.apache.calcite.sql.advise.SqlSimpleParser
A simple parser that takes an incomplete and turn it into a syntactically
 correct statement. It is used in the SQL editor user-interface.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classToken representing an identifier.static classToken.static classTokenizer.
- 
Constructor SummaryConstructorsConstructorDescriptionSqlSimpleParser(String hintToken) Deprecated.SqlSimpleParser(String hintToken, SqlParser.Config parserConfig) Creates a SqlSimpleParser.
- 
Method SummaryModifier and TypeMethodDescriptionsimplifySql(String sql) Turns a partially completed or syntactically incorrect SQL statement into a simplified, valid one that can be validated.simplifySql(String sql, int cursor) Turns a partially completed or syntactically incorrect sql statement into a simplified, valid one that can be passed into getCompletionHints().
- 
Constructor Details- 
SqlSimpleParserDeprecated.Creates a SqlSimpleParser.- Parameters:
- hintToken- Hint token
 
- 
SqlSimpleParserCreates a SqlSimpleParser.- Parameters:
- hintToken- Hint token
- parserConfig- parser configuration
 
 
- 
- 
Method Details- 
simplifySqlTurns a partially completed or syntactically incorrect sql statement into a simplified, valid one that can be passed into getCompletionHints().- Parameters:
- sql- A partial or syntactically incorrect sql statement
- cursor- to indicate column position in the query at which completion hints need to be retrieved.
- Returns:
- a completed, valid (and possibly simplified SQL statement
 
- 
simplifySqlTurns a partially completed or syntactically incorrect SQL statement into a simplified, valid one that can be validated.- Parameters:
- sql- A partial or syntactically incorrect sql statement
- Returns:
- a completed, valid (and possibly simplified) SQL statement
 
 
- 
SqlSimpleParser(String, SqlParser.Config)