amaliujia commented on a change in pull request #1587: [CALCITE-3272] Support 
TUMBLE as Table Valued Function including an enumerable implementation, 
stream.iq and DESCRIPTOR
URL: https://github.com/apache/calcite/pull/1587#discussion_r358056660
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
 ##########
 @@ -937,6 +950,22 @@ public static Expression translateLiteral(
     return list;
   }
 
+  private List<Expression> translateTableFunctionCall(RexCall rexCall) {
+    if (rexCall.op.getKind() == SqlKind.TUMBLE) {
+      assert rexCall.getOperands().get(2) instanceof RexLiteral;
+      Expression intervalExpression = translate(rexCall.getOperands().get(2));
+      RexCall descriptor = (RexCall) rexCall.getOperands().get(1);
+      List<Expression> translatedOperandsForTumble = new ArrayList<>();
+      translatedOperandsForTumble.add(
+          Expressions.constant(((RexInputRef) 
descriptor.getOperands().get(0)).getIndex()));
+      translatedOperandsForTumble.add(intervalExpression);
 
 Review comment:
   TUMBLE's signature is `TUMBLE(table, DESCRIPTOR(column_name), interval [, 
time ])`, so it's supposed to only have one column name in `DESCRIPTOR` to 
indicate watermarked event timestamp column.
   
   It's good question that where TUMBLE's signature is validated such that we 
know `DESCRIPTOR` only has one column name. The answer is seems to me that the 
best place is in parser, in which it will only create TUMBLE if `DESCRIPTOR` 
has one column. 
   
   I am planning to leave it as a future work.

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