jinxing64 commented on a change in pull request #1516: [CALCITE-3423] Support 
using CAST operation and BOOLEAN type value in table macro
URL: https://github.com/apache/calcite/pull/1516#discussion_r336722992
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java
 ##########
 @@ -147,6 +147,8 @@ private static Object getValue(SqlNode right) throws 
NonLiteralException {
         builder2.put(getValue(key), getValue(value));
       }
       return builder2.build();
+    case CAST:
+      return getValue(((SqlCall) right).operand(0));
 
 Review comment:
   > "All arguments of call to macro s.str should be literal"
   
   From above exception message from JIRA description, I understands that only 
literal is allowed for the macro.
   If we support CAST, do we target to support some other expressions ? like 
`select * from table("s"."str"(MAP['a', 1, 'baz', 2], 0 + 1)) as t(n)` ? Why we 
take `CAST` into special consideration ?
   

----------------------------------------------------------------
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