ArnavBalyan commented on code in PR #8560:
URL: https://github.com/apache/incubator-gluten/pull/8560#discussion_r1922420247


##########
shims/spark35/src/main/scala/org/apache/gluten/sql/shims/spark35/Spark35Shims.scala:
##########
@@ -554,7 +559,22 @@ class Spark35Shims extends SparkShims {
   override def isParquetFileEncrypted(
       fileStatus: LocatedFileStatus,
       conf: Configuration): Boolean = {
-    // TODO: Support will be added 
(https://github.com/apache/incubator-gluten/pull/8501)
-    return false
+    try {
+      val footer =
+        ParquetFileReader.readFooter(conf, fileStatus.getPath, 
ParquetMetadataConverter.NO_FILTER)
+      val fileMetaData = footer.getFileMetaData
+      fileMetaData.getEncryptionType match {
+        case EncryptionType.UNENCRYPTED =>
+          false
+        case EncryptionType.PLAINTEXT_FOOTER =>
+          true
+        case _ =>
+          false
+      }

Review Comment:
   Sorry accidentally deleted the comment, here is the code ref - 
https://github.com/apache/parquet-java/blob/master/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java#L1766.
 We still rely on the exception to check the footer + file encryption. The 
`EncryptionType.PLAINTEXT_FOOTER` checks for encrypted file but plain footer. 
It seems there is no doc on this, but hope the code ref helps. thanks!



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