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 Summary
ConstructorsConstructorDescriptionDrillSqlParseException(String sql, org.apache.calcite.sql.parser.SqlParseException sqlParseException) DrillSqlParseException(String sql, org.apache.calcite.sql.parser.SqlParserPos pos) -
Method Summary
Modifier and TypeMethodDescriptionBuilds error message just like the originalSqlParseExceptionwith special handling forParseExceptionclass.Formats sql query which caused the exception by adding error pointer ^ under incorrect expression.Methods inherited from class org.apache.calcite.sql.parser.SqlParseException
getCause, getExpectedTokenNames, getExpectedTokenSequences, getPos, getTokenImagesMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DrillSqlParseException
public DrillSqlParseException(String sql, org.apache.calcite.sql.parser.SqlParseException sqlParseException) -
DrillSqlParseException
-
-
Method Details
-
getMessage
Builds error message just like the originalSqlParseExceptionwith special handling forParseExceptionclass.This is customized implementation of the original
Throwable.getMessage(). Any other underlyingSqlParseExceptionexception messages goes through without changesExample:
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:
getMessagein classThrowable- Returns:
- formatted string representation of
DrillSqlParseException
-
getSqlWithErrorPointer
Formats sql query which caused the exception by adding error pointer ^ under incorrect expression.- Returns:
- The sql with a ^ character under the error
-