Class SqlParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.calcite.sql.parser.SqlParseException
All Implemented Interfaces:
Serializable, CalciteParserException

public class SqlParseException extends Exception implements CalciteParserException
SqlParseException defines a checked exception corresponding to SqlParser.
See Also:
  • Constructor Details

    • SqlParseException

      public SqlParseException(String message, SqlParserPos pos, int[][] expectedTokenSequences, String[] tokenImages, Throwable parserException)
      Creates a SqlParseException.
      Parameters:
      message - Message
      pos - Position
      expectedTokenSequences - Token sequences
      tokenImages - Token images
      parserException - Parser exception
  • Method Details

    • getPos

      public SqlParserPos getPos()
      Returns the position where this error occurred.
      Returns:
      parser position
    • getExpectedTokenNames

      public Collection<String> getExpectedTokenNames()
      Returns a list of the token names which could have legally occurred at this point.

      If some of the alternatives contain multiple tokens, returns the last token of only these longest sequences. (This occurs when the parser is maintaining more than the usual lookup.) For instance, if the possible tokens are

       {"IN"}
       {"BETWEEN"}
       {"LIKE"}
       {"=", "<IDENTIFIER>"}
       {"=", "USER"}
       

      returns

       "<IDENTIFIER>"
       "USER"
       
      Returns:
      list of token names which could have occurred at this point
    • getTokenImages

      public String[] getTokenImages()
      Returns the token images.
      Returns:
      token images
    • getExpectedTokenSequences

      public int[][] getExpectedTokenSequences()
      Returns the expected token sequences.
      Returns:
      expected token sequences
    • getCause

      public Throwable getCause()
      Overrides:
      getCause in class Throwable