rubenada commented on code in PR #3311:
URL: https://github.com/apache/calcite/pull/3311#discussion_r1262238357
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java:
##########
@@ -117,6 +117,25 @@ Expression fieldReference(Expression expression, int field,
*/
Expression generateAccessor(List<Integer> fields);
+ /** Similar to {@link #generateAccessor(List)}, but if one of the fields is
<code>null</code>,
+ * it will return <code>null</code>.
+ *
+ * <p>For example:
+ *
+ * <blockquote><pre>
+ * new Function1<Employee, Object[]> {
+ * public Object[] apply(Employee v1) {
+ * return v1.<fieldN> == null
+ * ? null
+ * : v1.<fieldM> == null
+ * ? null
+ * : FlatLists.of(v1.<fieldN>, v1.<fieldM>);
+ * }
+ * }
+ * }</pre></blockquote>
+ */
+ Expression generateNullableAccessor(List<Integer> fields);
Review Comment:
This is a fair point. It could be done, but I think that the "old" method
was still useful. Even though it would not be used any more within Calcite
core, it might be used by some Calcite clients (and I didn't want to "break"
their code by changing the implementation); so I considered it was arguably
better (and probably safer) to keep the old method as it was, and add a new one
with the peculiarities which are required for our hashJoin algorithm.
--
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]