rubenada commented on code in PR #5371:
URL: https://github.com/apache/calcite/pull/5371#discussion_r4415495903


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAsofJoin.java:
##########
@@ -166,8 +167,8 @@ private int getTimestampFieldIndex(RexCall call) {
     int leftFieldCount = left.getRowType().getFieldCount();
     List<RexNode> operands = call.getOperands();
     assert operands.size() == 2;
-    RexNode compareLeft = operands.get(0);
-    RexNode compareRight = operands.get(1);
+    RexNode compareLeft = RexUtil.removeCast(operands.get(0));

Review Comment:
   Note: unrelated minor issue unveiled by this patch: in certain cases, for 
the ASOF processing the validator adds an implicit CAST to one side of the 
match condition (e.g. when types are INTEGER and DECIMAL), hence we need to 
remove the potential CAST here, or we'd get an AssetionError below.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to