ViggoC commented on code in PR #3311:
URL: https://github.com/apache/calcite/pull/3311#discussion_r1262097516
##########
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:
Why not modify the original function implement, but create a new function
interface.
--
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]