ViggoC commented on code in PR #3311:
URL: https://github.com/apache/calcite/pull/3311#discussion_r1262252108
##########
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:
If so, IMHO it's better to use a name like generateIgnoreNullAccessor.
`generateAccessor` and `generateNullableAccessor` makes me feel like, if my
fields is nullable I should use the last one.
--
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]