shangxinli commented on a change in pull request #928:
URL: https://github.com/apache/parquet-mr/pull/928#discussion_r719478762



##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/ColumnEncryptor.java
##########
@@ -280,8 +288,12 @@ private void encryptPages(TransParquetFileReader reader, 
ColumnChunkMetaData chu
     }
   }
 
-  private byte[] encryptPayload(TransParquetFileReader reader, int 
payloadLength, BlockCipher.Encryptor dataEncryptor, byte[] AAD) throws 
IOException {
+  private byte[] encryptPayload(TransParquetFileReader reader, int 
payloadLength, BlockCipher.Encryptor dataEncryptor,

Review comment:
       I will fix 

##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/ColumnEncryptor.java
##########
@@ -180,21 +192,13 @@ private void processBlocks(TransParquetFileReader reader, 
ParquetFileWriter writ
   private void processChunk(ColumnDescriptor descriptor, ColumnChunkMetaData 
chunk, TransParquetFileReader reader, ParquetFileWriter writer,
                             Set<ColumnPath> encryptPaths, int blockId, int 
columnId, String createdBy) throws IOException {
     reader.setStreamPosition(chunk.getStartingPos());
-    // If current column chunk is asked to encrypt call encryptPages(), 
otherwise jut append this column chunk.
-    if (encryptPaths.contains(chunk.getPath())) {
-      writer.startColumn(descriptor, chunk.getValueCount(), chunk.getCodec());
-      encryptPages(reader, chunk, writer, createdBy, blockId, columnId);
-      writer.endColumn();
-    } else {
-      BloomFilter bloomFilter = reader.readBloomFilter(chunk);
-      ColumnIndex columnIndex = reader.readColumnIndex(chunk);
-      OffsetIndex offsetIndex = reader.readOffsetIndex(chunk);
-      writer.appendColumnChunk(descriptor, reader.getStream(), chunk, 
bloomFilter, columnIndex, offsetIndex);
-    }
+    writer.startColumn(descriptor, chunk.getValueCount(), chunk.getCodec());
+    encryptPages(reader, chunk, writer, createdBy, blockId, columnId, 
encryptPaths.contains(chunk.getPath()));
+    writer.endColumn();
   }
 
-  private void encryptPages(TransParquetFileReader reader, ColumnChunkMetaData 
chunk,
-                             ParquetFileWriter writer, String createdBy, int 
blockId, int columnId) throws IOException {
+  private void encryptPages(TransParquetFileReader reader, ColumnChunkMetaData 
chunk, ParquetFileWriter writer,

Review comment:
       I will fix




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


Reply via email to