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


##########
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:
   > Could we detect only one parquet file to read the metadata? If you would 
like to do the optimization, could you please wait for this PR 
https://github.com/apache/incubator-gluten/pull/11225/files#diff-169ab07f3b1741a5742eecd22865d93fb00b32028ea4e6dfbeaae2be056a1103R147
 to avoid too much conflict?
   
   @jinchengchenghh Let's first address the performance regressions as it 
affects all main stream code users. I opened a PR 
https://github.com/apache/incubator-gluten/pull/11233.



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