davisusanibar commented on code in PR #35570:
URL: https://github.com/apache/arrow/pull/35570#discussion_r1304705501
##########
java/dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanOptions.java:
##########
@@ -49,24 +51,72 @@ public ScanOptions(String[] columns, long batchSize) {
/**
* Constructor.
* @param batchSize Maximum row number of each returned {@link
org.apache.arrow.vector.ipc.message.ArrowRecordBatch}
- * @param columns (Optional) Projected columns. {@link Optional#empty()} for
scanning all columns. Otherwise,
+ * @param columnsSubset (Optional) Projected columns. {@link
Optional#empty()} for scanning all columns. Otherwise,
* Only columns present in the Array will be scanned.
*/
- public ScanOptions(long batchSize, Optional<String[]> columns) {
- Preconditions.checkNotNull(columns);
+ public ScanOptions(long batchSize, Optional<String[]> columnsSubset) {
+ Preconditions.checkNotNull(columnsSubset);
this.batchSize = batchSize;
- this.columns = columns;
+ this.columnsSubset = columnsSubset;
+ this.columnsProduceOrFilter = Optional.empty();
}
public ScanOptions(long batchSize) {
this(batchSize, Optional.empty());
}
- public Optional<String[]> getColumns() {
- return columns;
+ public Optional<String[]> getColumnsSubset() {
+ return columnsSubset;
}
public long getBatchSize() {
return batchSize;
}
+
+ public Optional<ByteBuffer> getColumnsProduceOrFilter() {
+ return columnsProduceOrFilter;
+ }
+
+ /**
+ * Builder for Options used during scanning.
+ */
+ public static class Builder {
+ private final long batchSize;
+ private final Optional<String[]> columnsSubset;
+ private Optional<ByteBuffer> columnsProduceOrFilter = Optional.empty();
+
+ /**
+ * Constructor.
+ * @param batchSize Maximum row number of each returned {@link
org.apache.arrow.vector.ipc.message.ArrowRecordBatch}
+ * @param columnsSubset (Optional) Projected columns. {@link
Optional#empty()} for scanning all columns. Otherwise,
+ * Only columns present in the Array will be scanned.
+ */
+ public Builder(long batchSize, Optional<String[]> columnsSubset) {
Review Comment:
deleted
##########
java/dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanOptions.java:
##########
@@ -49,24 +51,72 @@ public ScanOptions(String[] columns, long batchSize) {
/**
* Constructor.
* @param batchSize Maximum row number of each returned {@link
org.apache.arrow.vector.ipc.message.ArrowRecordBatch}
- * @param columns (Optional) Projected columns. {@link Optional#empty()} for
scanning all columns. Otherwise,
+ * @param columnsSubset (Optional) Projected columns. {@link
Optional#empty()} for scanning all columns. Otherwise,
* Only columns present in the Array will be scanned.
*/
- public ScanOptions(long batchSize, Optional<String[]> columns) {
- Preconditions.checkNotNull(columns);
+ public ScanOptions(long batchSize, Optional<String[]> columnsSubset) {
+ Preconditions.checkNotNull(columnsSubset);
this.batchSize = batchSize;
- this.columns = columns;
+ this.columnsSubset = columnsSubset;
+ this.columnsProduceOrFilter = Optional.empty();
}
public ScanOptions(long batchSize) {
this(batchSize, Optional.empty());
}
- public Optional<String[]> getColumns() {
- return columns;
+ public Optional<String[]> getColumnsSubset() {
+ return columnsSubset;
}
public long getBatchSize() {
return batchSize;
}
+
+ public Optional<ByteBuffer> getColumnsProduceOrFilter() {
+ return columnsProduceOrFilter;
+ }
+
+ /**
+ * Builder for Options used during scanning.
+ */
+ public static class Builder {
+ private final long batchSize;
+ private final Optional<String[]> columnsSubset;
+ private Optional<ByteBuffer> columnsProduceOrFilter = Optional.empty();
+
+ /**
+ * Constructor.
+ * @param batchSize Maximum row number of each returned {@link
org.apache.arrow.vector.ipc.message.ArrowRecordBatch}
+ * @param columnsSubset (Optional) Projected columns. {@link
Optional#empty()} for scanning all columns. Otherwise,
+ * Only columns present in the Array will be scanned.
+ */
+ public Builder(long batchSize, Optional<String[]> columnsSubset) {
+ Preconditions.checkNotNull(columnsSubset);
+ this.batchSize = batchSize;
+ this.columnsSubset = columnsSubset;
+ }
+
+ /**
+ * Define binary extended expression message for projects new columns or
applies filter.
+ *
+ * @param columnsProduceOrFilter (Optional) Expressions to evaluate to
projects new columns or applies filter.
+ * @return the ScanOptions configured.
+ */
+ public Builder columnsProduceOrFilter(Optional<ByteBuffer>
columnsProduceOrFilter) {
Review Comment:
changed
--
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]