Skip to content

Commit a3ac6e4

Browse files
committed
fix: fallback to Spark scan if encryption is enabled (native_datafusion/native_iceberg_compat)
1 parent c8d4762 commit a3ac6e4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ case class CometScanRule(session: SparkSession) extends Rule[SparkPlan] {
118118
return withInfos(scanExec, fallbackReasons.toSet)
119119
}
120120

121+
val encryptionEnabled: Boolean =
122+
conf.getConfString("parquet.crypto.factory.class", "").nonEmpty &&
123+
conf.getConfString("parquet.encryption.kms.client.class", "").nonEmpty
124+
125+
if (scanImpl != CometConf.SCAN_NATIVE_COMET && encryptionEnabled) {
126+
fallbackReasons +=
127+
"Full native scan disabled because encryption is not supported"
128+
return withInfos(scanExec, fallbackReasons.toSet)
129+
}
130+
121131
val typeChecker = new CometScanTypeChecker(scanImpl)
122132
val schemaSupported =
123133
typeChecker.isSchemaSupported(scanExec.requiredSchema, fallbackReasons)

0 commit comments

Comments
 (0)