rdblue commented on a change in pull request #2248:
URL: https://github.com/apache/iceberg/pull/2248#discussion_r580693954
##########
File path: spark3/src/main/java/org/apache/iceberg/spark/Spark3Util.java
##########
@@ -474,15 +476,33 @@ public static boolean isLocalityEnabled(FileIO io, String
location, CaseInsensit
return false;
}
- public static boolean isVectorizationEnabled(Map<String, String> properties,
CaseInsensitiveStringMap readOptions) {
- String batchReadsSessionConf = SparkSession.active().conf()
- .get("spark.sql.iceberg.vectorization.enabled", null);
- if (batchReadsSessionConf != null) {
- return Boolean.valueOf(batchReadsSessionConf);
+ public static boolean isVectorizationEnabled(FileFormat fileFormat,
+ Map<String, String> properties,
+ RuntimeConfig sessionConf,
+ CaseInsensitiveStringMap
readOptions) {
+
+ String readOptionValue =
readOptions.get(SparkReadOptions.VECTORIZATION_ENABLED);
+ if (readOptionValue != null) {
+ return Boolean.parseBoolean(readOptionValue);
Review comment:
Looks like this reverses the order of precedence. Before,
`spark.sql.iceberg.vectorization.enabled` could be used to disable all
vectorized reads, even if the read option was set to specifically enable them.
Now, the read option will override.
I'm not sure what the right behavior is. The read option seems "closer" in
that it overrides global defaults. But the read option is likely compiled into
job jars, so the one you can change at runtime would be
`spark.sql.iceberg.vectorization.enabled`. I would lean toward keeping the
existing behavior instead of changing it, but I could be convinced otherwise.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]