This is an automated email from the ASF dual-hosted git repository.

gershinsky pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-java.git


The following commit(s) were added to refs/heads/master by this push:
     new fb6f0be03 Improve exception message in InternalFileDecryptor. (#3143)
fb6f0be03 is described below

commit fb6f0be0323f5f52715b54b8c6602763d8d0128d
Author: Yujiang Zhong <[email protected]>
AuthorDate: Thu Feb 6 21:13:57 2025 +0800

    Improve exception message in InternalFileDecryptor. (#3143)
---
 .../java/org/apache/parquet/crypto/InternalFileDecryptor.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/parquet-hadoop/src/main/java/org/apache/parquet/crypto/InternalFileDecryptor.java
 
b/parquet-hadoop/src/main/java/org/apache/parquet/crypto/InternalFileDecryptor.java
index 993eca02e..eb0e59e74 100755
--- 
a/parquet-hadoop/src/main/java/org/apache/parquet/crypto/InternalFileDecryptor.java
+++ 
b/parquet-hadoop/src/main/java/org/apache/parquet/crypto/InternalFileDecryptor.java
@@ -232,7 +232,7 @@ public class InternalFileDecryptor {
               "Re-use: wrong encryption key (column vs footer). Column: " + 
path);
         }
         if (!encryptedWithFooterKey && 
!Arrays.equals(columnDecryptionSetup.getKeyMetadata(), keyMetadata)) {
-          throw new ParquetCryptoRuntimeException("Decryptor re-use: Different 
footer key metadata ");
+          throw new ParquetCryptoRuntimeException("Decryptor re-use: Different 
footer key metadata");
         }
       }
       return columnDecryptionSetup;
@@ -244,7 +244,8 @@ public class InternalFileDecryptor {
     } else {
       if (encryptedWithFooterKey) {
         if (null == footerKey) {
-          throw new ParquetCryptoRuntimeException("Column " + path + " is 
encrypted with NULL footer key");
+          throw new ParquetCryptoRuntimeException(
+              "Column " + path + " is encrypted with footer key, but the 
provided footer key is NULL");
         }
         columnDecryptionSetup = new InternalColumnDecryptionSetup(
             path,
@@ -269,7 +270,8 @@ public class InternalFileDecryptor {
           }
         }
         if (null == columnKeyBytes) {
-          throw new ParquetCryptoRuntimeException("Column " + path + "is 
encrypted with NULL column key");
+          throw new ParquetCryptoRuntimeException("Column " + path
+              + " is encrypted with column-specific key, but the provided 
column key is NULL");
         }
         columnDecryptionSetup = new InternalColumnDecryptionSetup(
             path,

Reply via email to