[
https://issues.apache.org/jira/browse/PARQUET-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17730189#comment-17730189
]
ASF GitHub Bot commented on PARQUET-2305:
-----------------------------------------
wgtmac commented on code in PR #1102:
URL: https://github.com/apache/parquet-mr/pull/1102#discussion_r1221872560
##########
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoConstants.java:
##########
@@ -26,6 +26,7 @@ public final class ProtoConstants {
public static final String METADATA_ENUM_PREFIX = "parquet.proto.enum.";
public static final String METADATA_ENUM_KEY_VALUE_SEPARATOR = ":";
public static final String METADATA_ENUM_ITEM_SEPARATOR = ",";
+ public static final String IGNORE_UNKNOWN_FIELDS = "IGNORE_UNKNOWN_FIELDS";
Review Comment:
```suggestion
public static final String CONFIG_IGNORE_UNKNOWN_FIELDS =
"parquet.proto.ignore.unknwon.fields";
```
It would be better to follow same the style of CONFIG_ACCEPT_UNKNOWN_ENUM.
##########
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoConstants.java:
##########
@@ -26,6 +26,7 @@ public final class ProtoConstants {
public static final String METADATA_ENUM_PREFIX = "parquet.proto.enum.";
public static final String METADATA_ENUM_KEY_VALUE_SEPARATOR = ":";
public static final String METADATA_ENUM_ITEM_SEPARATOR = ",";
+ public static final String IGNORE_UNKNOWN_FIELDS = "IGNORE_UNKNOWN_FIELDS";
Review Comment:
In addition, could you also add some comment to describe its purpose?
> Allow Parquet to Proto conversion even though Target Schema has less fields
> ---------------------------------------------------------------------------
>
> Key: PARQUET-2305
> URL: https://issues.apache.org/jira/browse/PARQUET-2305
> Project: Parquet
> Issue Type: Improvement
> Components: parquet-protobuf
> Reporter: Sanjay Sharma
> Priority: Major
>
> If Parquet has any field which has been removed from the schema and Parquet
> to Proto conversion happens, it errors out due to Unknown fields. There could
> be some scenarios that we want to still convert PARQUET into the target proto
> schema object which has lesser fields.
> If specified "ignoreUnknownFields" as an argument, this should allow the
> conversion which ignore fields it can't convert and not error out.
> Similar functionality exist in
> [https://github.com/protocolbuffers/protobuf/blob/main/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java]
> with field "ignoringUnknownFields"
--
This message was sent by Atlassian Jira
(v8.20.10#820010)