Class DrillSqlParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.calcite.sql.parser.SqlParseException
org.apache.drill.exec.planner.sql.parser.impl.DrillSqlParseException
All Implemented Interfaces:
Serializable, org.apache.calcite.util.CalciteParserException

public class DrillSqlParseException extends org.apache.calcite.sql.parser.SqlParseException
Customized SqlParseException class
See Also:
  • Constructor Details

    • DrillSqlParseException

      public DrillSqlParseException(String sql, org.apache.calcite.sql.parser.SqlParseException sqlParseException)
    • DrillSqlParseException

      public DrillSqlParseException(String sql, org.apache.calcite.sql.parser.SqlParserPos pos)
  • Method Details

    • getMessage

      public String getMessage()
      Builds error message just like the original SqlParseException with special handling for ParseException class.

      This is customized implementation of the original Throwable.getMessage(). Any other underlying SqlParseException exception messages goes through without changes

      Example:

      
         Given query: SELECT FROM (VALUES(1));
      
         Generated message for the unsupported FROM token after SELECT would look like:
      
             Encountered "FROM" at line 1, column 8.
      
      Overrides:
      getMessage in class Throwable
      Returns:
      formatted string representation of DrillSqlParseException
    • getSqlWithErrorPointer

      public String getSqlWithErrorPointer()
      Formats sql query which caused the exception by adding error pointer ^ under incorrect expression.
      Returns:
      The sql with a ^ character under the error