@@ -250,17 +250,22 @@ public void testCommandExists() {
250250 public void testColumnEncryptedFileWithKeys () throws IOException {
251251 assertTrue (columnEncryptedFile .exists ());
252252
253+ enableCliDecryptionKeys ();
254+
253255 EncryptionInfoCommand cmd = new EncryptionInfoCommand (createLogger ());
254256 cmd .targets = java .util .Arrays .asList (columnEncryptedFile .getAbsolutePath ());
255257 cmd .setConf (new Configuration ());
256258
257259 int rc = cmd .run ();
258260 assertEquals (0 , rc );
259261
260- ParquetMetadata footer = ParquetFileReader .readFooter (
261- new Configuration (),
262- new Path (columnEncryptedFile .getAbsolutePath ()),
263- ParquetMetadataConverter .NO_FILTER );
262+ FileDecryptionProperties decryptionProps = createDecryptionProperties ();
263+ ParquetReadOptions options = ParquetReadOptions .builder ().withDecryption (decryptionProps ).build ();
264+ InputFile inputFile = HadoopInputFile .fromPath (new Path (columnEncryptedFile .getAbsolutePath ()), new Configuration ());
265+ ParquetMetadata footer ;
266+ try (ParquetFileReader reader = ParquetFileReader .open (inputFile , options )) {
267+ footer = reader .getFooter ();
268+ }
264269 Set <String > encrypted = EncryptionInfoCommand .findEncryptedColumns (footer );
265270 assertEquals (Collections .singleton ("ssn" ), encrypted );
266271 }
@@ -281,6 +286,7 @@ public void testFooterEncryptedFileWithKeys() throws IOException {
281286 }
282287
283288 ByteArrayOutputStream out = new ByteArrayOutputStream ();
289+ enableCliDecryptionKeys ();
284290 Logger logger = createLogger (new PrintStream (out ));
285291 EncryptionInfoCommand cmd = new EncryptionInfoCommand (logger );
286292 cmd .targets = java .util .Arrays .asList (footerEncryptedFile .getAbsolutePath ());
0 commit comments