You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/21 12:15:33 UTC

[GitHub] [calcite] vvysotskyi commented on a change in pull request #1492: [CALCITE-3390] Add ITEM expression to SqlKind and include it in the p…

vvysotskyi commented on a change in pull request #1492: [CALCITE-3390] Add ITEM expression to SqlKind and include it in the p…
URL: https://github.com/apache/calcite/pull/1492#discussion_r336982437
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/RexProgramTest.java
 ##########
 @@ -624,6 +624,13 @@ private RexProgramBuilder createProg(int variant) {
             case_(isNotNull(i0), i0, i1), c01),
         is(true));
 
+    final RelDataType intArray = typeFactory.createArrayType(intType, -1);
+    RexInputRef inputRef = rexBuilder.makeInputRef(intArray, 0);
+    RexNode rexNode = rexBuilder.makeCall(
+        SqlStdOperatorTable.ITEM,
+        inputRef,
+        rexBuilder.makeLiteral(0, intType, false));
 
 Review comment:
   I think it was meant that `a` and `b` are numeric columns, so `a.item(b+c)` is a call for obtaining array element, but I think that this case is not connected with `ITEM` itself since it checks how strong logic is applied to function arguments, and we already have such tests.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services