Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
In the following sql:
select name[0] from dept
name is a field of VARCHAR type, the follow exception message is thrown out:
java.lang.AssertionError: VARCHAR at org.apache.calcite.sql.fun.SqlItemOperator.getChecker(SqlItemOperator.java:109) at org.apache.calcite.sql.fun.SqlItemOperator.checkOperandTypes(SqlItemOperator.java:91) at org.apache.calcite.sql.SqlOperator.validateOperands(SqlOperator.java:432) at org.apache.calcite.sql.SqlOperator.deriveType(SqlOperator.java:516) at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5607) at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5594) at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:139)
The exception message is hard to understand for user. I think a message like "Cannot apply item opeator to VARCHAR type for filed "name" at line xx column xx " is more friendly to the user.
Attachments
Issue Links
- links to