sunchao commented on code in PR #2276:
URL: https://github.com/apache/iceberg/pull/2276#discussion_r999787494


##########
api/src/main/java/org/apache/iceberg/Scan.java:
##########
@@ -129,6 +129,34 @@ default ThisT select(String... columns) {
    */
   ThisT planWith(ExecutorService executorService);
 
+  /**
+   * Create a new {@link TableScan} which dictates that when plan tasks via 
the {@link
+   * #planTasks()}, the scan should preserve partition boundary specified by 
the provided partition
+   * column names. In other words, the scan will not attempt to combine tasks 
whose input files have
+   * different partition data w.r.t `columns`.
+   *
+   * @param columns the partition column names to preserve boundary when 
planning tasks
+   * @return a table scan preserving partition boundary when planning tasks
+   * @throws IllegalArgumentException if any of the input columns is not a 
partition column, or if
+   *     the table is un-partitioned.
+   */
+  ThisT preservePartitions(Collection<String> columns);
+
+  /**
+   * Create a new {@link TableScan} which dictates that when plan tasks via 
the {@link
+   * #planTasks()}, the scan should preserve partition boundary specified by 
the provided partition

Review Comment:
   It'll pass the partition expressions to Iceberg, and is a subset of 
partition expressions Spark obtained via `SupportsReportPartitioning` from 
Iceberg, when the returned partitioning type is `KeyGroupedPartitioning`.
   
   I think the partition expressions will be first processed via 
`SparkScanBuilder` (via a new interface to be introduced by Spark) and the 
actual partition columns will be passed to this method. Does that sound 
reasonable?



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to