You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/02/26 13:24:27 UTC

[GitHub] [calcite] rubenada commented on a change in pull request #2353: [CALCITE-2000] UNNEST a collection that has a field with nested data generates an Exception

rubenada commented on a change in pull request #2353:
URL: https://github.com/apache/calcite/pull/2353#discussion_r583635078



##########
File path: core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
##########
@@ -2792,27 +2792,28 @@ public static Collection multisetUnionAll(Collection collection1,
    * Function that, given a certain List containing single-item structs (i.e. arrays / lists with
    * a single item), builds an Enumerable that returns those single items inside the structs.
    */
-  public static Function1<Object, Enumerable<Comparable>> flatList() {
+  public static Function1<Object, Enumerable<Object>> flatList() {

Review comment:
       {{SqlFunction#flatList}} was introduced in 1.24 via CALCITE-4063, and it is a counter-part of {{flatProduct}} for a very particular case. So, following {{flatProduct}}'s logic, inputObject cannot be null, so I guess {{flatList}} should look like:
   ```
     public static Function1<Object, Enumerable<Object>> flatList() {
       return inputObject -> {
         //noinspection unchecked
         final List<Object> list = (List<Object>) inputObject;
         final Enumerator<Object> enumerator = Linq4j.enumerator(list);
         ...
   ```
   do you agree?      




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org