thomasrebele commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1666061332


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, 
PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   Indeed, I had not implemented `JavaRowFormat.copy()`, as I didn't know how 
to do that. Seems that the input would be `org.apache.calcite.interpreter.Row` 
according to the generated code. I'm astonished that the return type is not of 
the same type.
   The `JavaRowFormat.copy()` would need to return an `Expression` that 
represents the code to copy the data from the left and right 
`org.apache.calcite.interpreter.Row`. Not sure whether an `ARRAY_COPY` could be 
used here. Alternatively, the generated code could be a for loop, here some 
pseudo-code:
   ```
   int outIdx = 0;
   for(int leftIdx = 0; leftIdx < left length; leftIdx++) {
     outputArray[outIdx++] = left item at position leftIdx;
   }
   for(int rightIdx = 0; rightIdx < right length; rightIdx++) {
     outputArray[outIdx++] = right item at position rightIdx;
   }
   ```



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