You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "adamreeve (via GitHub)" <gi...@apache.org> on 2026/05/05 05:04:53 UTC

[PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

adamreeve opened a new pull request, #9895:
URL: https://github.com/apache/arrow-rs/pull/9895

   # Which issue does this PR close?
   
   - Closes #9721.
   
   # Are these changes tested?
   
   Yes, includes new unit tests.
   
   # Are there any user-facing changes?
   
   Yes, there is a new public API method.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "adamreeve (via GitHub)" <gi...@apache.org>.
adamreeve commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3344720639


##########
parquet/src/encryption/decrypt.rs:
##########
@@ -432,6 +432,12 @@ impl FileDecryptionProperties {
         }
         (column_names, column_keys)
     }
+
+    /// Whether these decryption properties use a key retriever.
+    /// When false, keys can be retrieved without providing key metadata.

Review Comment:
   I've incorporated this suggestion but kept the bit about not needing to provide key metadata to retrieve keys, which I think is useful to document.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3342260075


##########
parquet/tests/encryption/encryption.rs:
##########
@@ -1474,3 +1474,29 @@ fn test_decrypt_page_index(
 
     Ok(())
 }
+
+#[test]
+fn test_decryption_properties_uses_key_retriever() {
+    let key_retriever = TestKeyRetriever::new()
+        .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec())
+        .with_key("kc1".to_owned(), "1234567890123450".as_bytes().to_vec());

Review Comment:
   Do we need two different column keys?
   ```suggestion
           .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec());
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3342260075


##########
parquet/tests/encryption/encryption.rs:
##########
@@ -1474,3 +1474,29 @@ fn test_decrypt_page_index(
 
     Ok(())
 }
+
+#[test]
+fn test_decryption_properties_uses_key_retriever() {
+    let key_retriever = TestKeyRetriever::new()
+        .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec())
+        .with_key("kc1".to_owned(), "1234567890123450".as_bytes().to_vec());

Review Comment:
   Do we need two different column keys?
   ```suggestion
           .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec());
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3342317801


##########
parquet/tests/encryption/encryption.rs:
##########
@@ -1474,3 +1474,29 @@ fn test_decrypt_page_index(
 
     Ok(())
 }
+
+#[test]
+fn test_decryption_properties_uses_key_retriever() {
+    let key_retriever = TestKeyRetriever::new()
+        .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec())
+        .with_key("kc1".to_owned(), "1234567890123450".as_bytes().to_vec());
+
+    let properties_with_retriever =
+        FileDecryptionProperties::with_key_retriever(Arc::new(key_retriever))
+            .build()
+            .unwrap();
+
+    assert!(properties_with_retriever.uses_key_retriever());
+
+    let footer_key = "0123456789012345".as_bytes();
+    let column_1_key = "1234567890123450".as_bytes();
+    let column_2_key = "1234567890123451".as_bytes();
+
+    let properties_with_keys = FileDecryptionProperties::builder(footer_key.to_vec())
+        .with_column_key("double_field", column_1_key.to_vec())
+        .with_column_key("float_field", column_2_key.to_vec())
+        .build()
+        .unwrap();
+
+    assert!(!properties_with_keys.uses_key_retriever());

Review Comment:
   Maybe test uniform case as well?
   
   ```suggestion
       assert!(!properties_with_keys.uses_key_retriever());
   
       let properties_uniform = FileDecryptionProperties::builder(footer_key.to_vec())
           .build()
           .unwrap();
   
       assert!(!properties_uniform.uses_key_retriever());
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "adamreeve (via GitHub)" <gi...@apache.org>.
adamreeve commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3344723037


##########
parquet/tests/encryption/encryption.rs:
##########
@@ -1474,3 +1474,29 @@ fn test_decrypt_page_index(
 
     Ok(())
 }
+
+#[test]
+fn test_decryption_properties_uses_key_retriever() {
+    let key_retriever = TestKeyRetriever::new()
+        .with_key("kf".to_owned(), "0123456789012345".as_bytes().to_vec())
+        .with_key("kc1".to_owned(), "1234567890123450".as_bytes().to_vec());
+
+    let properties_with_retriever =
+        FileDecryptionProperties::with_key_retriever(Arc::new(key_retriever))
+            .build()
+            .unwrap();
+
+    assert!(properties_with_retriever.uses_key_retriever());
+
+    let footer_key = "0123456789012345".as_bytes();
+    let column_1_key = "1234567890123450".as_bytes();
+    let column_2_key = "1234567890123451".as_bytes();
+
+    let properties_with_keys = FileDecryptionProperties::builder(footer_key.to_vec())
+        .with_column_key("double_field", column_1_key.to_vec())
+        .with_column_key("float_field", column_2_key.to_vec())
+        .build()
+        .unwrap();

Review Comment:
   :+1: I've changed to one column key and switched to using the new constants that were added recently.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895#discussion_r3342252173


##########
parquet/src/encryption/decrypt.rs:
##########
@@ -432,6 +432,12 @@ impl FileDecryptionProperties {
         }
         (column_names, column_keys)
     }
+
+    /// Whether these decryption properties use a key retriever.
+    /// When false, keys can be retrieved without providing key metadata.

Review Comment:
   ```suggestion
       /// When false, explicit keys were provided up front rather than resolved on demand.
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(parquet): add uses_key_retriever method to FileDecryptionProperties [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9895:
URL: https://github.com/apache/arrow-rs/pull/9895


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org