[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245239039


##
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java:
##
@@ -1428,9 +1431,17 @@ public FileMetaDataAndRowGroupOffsetInfo(FileMetaData 
fileMetadata, Map

[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245235188


##
parquet-hadoop/src/main/java/org/apache/parquet/crypto/HiddenColumnException.java:
##
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.parquet.crypto;
+
+import java.util.Arrays;
+
+import org.apache.parquet.ParquetRuntimeException;
+
+/**
+ * Reader doesn't have key for encrypted column,
+ * but tries to access its contents
+ *
+ */
+public class HiddenColumnException extends ParquetRuntimeException {
+  private static final long serialVersionUID = 1L;
+  private static final String configHelpText = " If returning 'null' for 
encrypted columns is acceptable," +
+" please add 'set parquet.crypto.read.masked.value.enabled=true;' before 
your query" +

Review Comment:
   You can reword it like the user doesn't have permission. If return null for 
this non-permitted column is acceptable,  set config 
'parquet.crypto.read.masked.value.enabled' to 'true'



-- 
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: dev-unsubscr...@parquet.apache.org

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



[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245232287


##
parquet-hadoop/src/main/java/org/apache/parquet/HadoopReadOptions.java:
##
@@ -35,6 +35,8 @@
 import static 
org.apache.parquet.hadoop.ParquetInputFormat.DICTIONARY_FILTERING_ENABLED;
 import static 
org.apache.parquet.hadoop.ParquetInputFormat.BLOOM_FILTERING_ENABLED;
 import static 
org.apache.parquet.hadoop.ParquetInputFormat.OFF_HEAP_DECRYPT_BUFFER_ENABLED;
+import static 
org.apache.parquet.hadoop.ParquetInputFormat.READ_MASKED_VALUE_ENABLED;
+import static 
org.apache.parquet.hadoop.ParquetInputFormat.MASKED_COLUMN_VISIBLE_ENABLED;

Review Comment:
   Why we need this parameter? I thought only one is sufficient 



-- 
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: dev-unsubscr...@parquet.apache.org

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



[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245231331


##
parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnReadStoreImpl.java:
##
@@ -75,6 +75,9 @@ public ColumnReadStoreImpl(PageReadStore pageReadStore,
   public ColumnReader getColumnReader(ColumnDescriptor path) {
 PrimitiveConverter converter = getPrimitiveConverter(path);
 PageReader pageReader = pageReadStore.getPageReader(path);
+if (pageReader.isNullMaskedColumn()) {

Review Comment:
   This change might not needed 



-- 
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: dev-unsubscr...@parquet.apache.org

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



[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245230480


##
parquet-column/src/main/java/org/apache/parquet/column/page/PageReader.java:
##
@@ -37,4 +37,10 @@ public interface PageReader {
* @return the next page in that chunk or null if after the last page
*/
   DataPage readPage();
+
+  /**
+   *  Check if current column is hidden

Review Comment:
   The comment and the method name has diescrepency



-- 
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: dev-unsubscr...@parquet.apache.org

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



[GitHub] [parquet-mr] shangxinli commented on a diff in pull request #1112: PARQUET-2223: Add Data Masking Feature for Column Encryption

2023-06-28 Thread via GitHub


shangxinli commented on code in PR #1112:
URL: https://github.com/apache/parquet-mr/pull/1112#discussion_r1245226667


##
parquet-format-structures/pom.xml:
##
@@ -156,6 +156,11 @@
   libthrift
   ${format.thrift.version}
 
+

Review Comment:
   Why we need this? 



-- 
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: dev-unsubscr...@parquet.apache.org

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