chunweilei commented on a change in pull request #1149: [CALCITE-2982] 
SqlItemOperator should throw understandable exception …
URL: https://github.com/apache/calcite/pull/1149#discussion_r275119391
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
 ##########
 @@ -8112,6 +8112,11 @@ public void _testGroupExpressionEquivalenceParams() {
         .type("RecordType(VARCHAR(10) OA) NOT NULL");
   }
 
+  @Test public void testItemOperatorException() {
+    sql("select ^name^[0] from dept")
+        .fails("Cannot apply item operator to 'VARCHAR' for field 
'DEPT.NAME'");
 
 Review comment:
   I think error message like` Cannot apply item operator to 'VARCHAR' type` is 
enough.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to