vlsi commented on a change in pull request #1896: 3877, 3892, 3814 and 3876
URL: https://github.com/apache/calcite/pull/1896#discussion_r403445682
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/schema/Schemas.java
 ##########
 @@ -224,15 +224,15 @@ public static DataContext createDataContext(
    * array. */
   public static Enumerable<Object[]> enumerable(final FilterableTable table,
       final DataContext root) {
-    return table.scan(root, ImmutableList.of());
+    return table.scan(root, new ArrayList<>());
   }
 
   /** Returns an {@link org.apache.calcite.linq4j.Enumerable} over the rows of
    * a given table, not applying any filters and projecting all columns,
    * representing each row as an object array. */
   public static Enumerable<Object[]> enumerable(
       final ProjectableFilterableTable table, final DataContext root) {
-    return table.scan(root, ImmutableList.of(),
+    return table.scan(root, new ArrayList<>(),
         identity(table.getRowType(root.getTypeFactory()).getFieldCount()));
 
 Review comment:
   If you think the contract is to treat the list as fully mutable, then, 
adjust the Javadoc, and adjust the implementation so it handles the mutations 
of the list.
   
   In other words, for now you pass an ArrayList and expect it to be mutated. 
However, you seem to ignore the mutated value of the ArrayList, so the new code 
might result in invalid data being returned.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to