FelixYBW commented on code in PR #11117:
URL: 
https://github.com/apache/incubator-gluten/pull/11117#discussion_r2575729083


##########
backends-velox/src/main/scala/org/apache/gluten/utils/ParquetMetadataUtils.scala:
##########
@@ -82,21 +87,63 @@ object ParquetMetadataUtils {
    * @return
    *   True if an encrypted file is detected, false otherwise
    */
-  private def checkForEncryptionWithLimit(
+  private def checkForUnexpectedMetadataWithLimit(
       fs: FileSystem,
       path: Path,
       conf: Configuration,
+      parquetOptions: ParquetOptions,
       fileLimit: Int
-  ): Boolean = {
-
+  ): Option[String] = {
+    val isEncryptionValidationEnabled = 
GlutenConfig.get.parquetEncryptionValidationEnabled
     val filesIterator: RemoteIterator[LocatedFileStatus] = fs.listFiles(path, 
true)
     var checkedFileCount = 0
     while (filesIterator.hasNext && checkedFileCount < fileLimit) {
       val fileStatus = filesIterator.next()
       checkedFileCount += 1
-      if (SparkShimLoader.getSparkShims.isParquetFileEncrypted(fileStatus, 
conf)) {
-        return true
+      if (
+        isEncryptionValidationEnabled && 
SparkShimLoader.getSparkShims.isParquetFileEncrypted(

Review Comment:
   @zhztheplayer is one parquet file enough or should we sample several files? 
I remember anohter PR added a sample files number. We may use the same one.



-- 
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]

Reply via email to