davisusanibar commented on code in PR #35570:
URL: https://github.com/apache/arrow/pull/35570#discussion_r1312995270
##########
java/dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanOptions.java:
##########
@@ -69,4 +73,106 @@ public Optional<String[]> getColumns() {
public long getBatchSize() {
return batchSize;
}
+
+ private ByteBuffer getProjection() {
+ return projection;
+ }
+
+ private ByteBuffer getFilter() {
+ return filter;
+ }
+
+ private ByteBuffer getProjectionAndFilter() {
+ return projectionAndFilter;
+ }
+
+ /**
+ * To evaluate what option was used to define Substrait Extended Expression
(Project/Filter).
+ *
+ * @return Substrait Extended Expression configured for project new columns
and/or apply filter
+ */
+ public ByteBuffer getSubstraitExtendedExpression() {
+ if (getProjection() != null) {
+ return getProjection();
+ } else if (getFilter() != null) {
+ return getFilter();
+ } else if (getProjectionAndFilter() != null) {
+ return getProjectionAndFilter();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Builder for Options used during scanning.
+ */
+ public static class Builder {
+ private final long batchSize;
+ private final Optional<String[]> columns;
+ private ByteBuffer projection;
+ private ByteBuffer filter;
+ private ByteBuffer projectionAndFilter;
+
+ /**
+ * 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,
+ * Only columns present in the Array will be scanned.
+ */
+ public Builder(long batchSize, Optional<String[]> columns) {
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]