zhztheplayer commented on a change in pull request #10652:
URL: https://github.com/apache/arrow/pull/10652#discussion_r716209350



##########
File path: 
java/dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanOptions.java
##########
@@ -26,12 +26,16 @@
 
   /**
    * Constructor.
-   * @param columns Projected columns. Empty for scanning all columns.
    * @param batchSize Maximum row number of each returned {@link 
org.apache.arrow.vector.ipc.message.ArrowRecordBatch}
+   * @param columns Projected columns. Null for scanning all columns.
    */
-  public ScanOptions(String[] columns, long batchSize) {
-    this.columns = columns;
+  public ScanOptions(long batchSize, String[] columns) {

Review comment:
       Just to clarify, would you suggest to change the constructor to 
something like:
   
   ```Java
   public ScanOptions(long batchSize, Optional<String[]> columns)
   ```
   
   or 
   ```Java
   public ScanOptions(Optional<String[]> columns, long batchSize)
   ```
   ? The issue we are trying to solve here is to make empty `columns` select 
zero columns rather than all columns (previous behavior). I don't think we can 
do anything to keep the compatibility when empty `columns` is specified.
   
   Or by backwards compatibility you meant the compatibility in future changes? 
Then I don't have strong preference on using Optionals or nulls. Or maybe 
adding a builder pattern will also help? We will certainly have more options in 
future.
   




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


Reply via email to