karuppayya commented on code in PR #16088:
URL: https://github.com/apache/iceberg/pull/16088#discussion_r3230630107
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkScan.java:
##########
@@ -369,8 +369,19 @@ public CustomMetric[] supportedCustomMetrics() {
protected long adjustSplitSize(List<? extends ScanTask> tasks, long
splitSize) {
if (readConf.splitSizeOption() == null &&
readConf.adaptiveSplitSizeEnabled()) {
long scanSize = tasks.stream().mapToLong(ScanTask::sizeBytes).sum();
- int parallelism = readConf.parallelism();
- return TableScanUtil.adjustSplitSize(scanSize, parallelism, splitSize);
+ Integer configuredParallelism = readConf.splitParallelism();
+ int parallelism =
Review Comment:
Moved
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkScan.java:
##########
@@ -1106,6 +1107,53 @@ public void testIncrementalScanDescription() throws
Exception {
});
}
Review Comment:
1. Created a seperate test file
2 and 3 handled
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/SparkSQLProperties.java:
##########
@@ -110,6 +110,13 @@ private SparkSQLProperties() {}
// Prefix for custom snapshot properties
public static final String SNAPSHOT_PROPERTY_PREFIX =
"spark.sql.iceberg.snapshot-property.";
+ // Controls whether adaptive split sizing is enabled
+ public static final String READ_ADAPTIVE_SPLIT_SIZE_ENABLED =
+ "spark.sql.iceberg.read.adaptive-split-size.enabled";
+
+ // Controls the parallelism used for adaptive split sizing
+ public static final String READ_SPLIT_PARALLELISM =
"spark.sql.iceberg.read.split.parallelism";
Review Comment:
done
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/SparkReadConf.java:
##########
@@ -290,6 +291,14 @@ public int parallelism() {
return Math.max(defaultParallelism, numShufflePartitions);
}
+ public Integer splitParallelism() {
+ Integer parallelism =
+
confParser.intConf().sessionConf(SparkSQLProperties.READ_SPLIT_PARALLELISM).parseOptional();
Review Comment:
I think this is runtime property(for Spark it depends on cores+memory of the
application)
Do we want to make it part of table property?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]