ProtoMessageConverter fails for unknown proto fields
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 33
説明
Hi
We have Spark application that reads parquet files and turns them into a Protobuf RDD like the code below [1]. However, if the parquet schema contain fields that doesn't exist in protobuf class an IncompatibleSchemaModificationException [2] is thrown.
For compatibility reasons it would be nice to make it possible to ignore fields instead of throwing an exception. Maybe as an configuration? The fix for ignoring fields is quite easy, just instantiate an empty PrimitiveConverter instead.
Cheers,
-Kristoffer
[1]
JobConf conf = new JobConf(ctx.hadoopConfiguration());
FileInputFormat.setInputPaths(conf, rawPath);
ProtoReadSupport.setProtobufClass(conf, Msg.class.getName());
NewHadoopRDD rdd =
new NewHadoopRDD(ctx.sc(), ProtoParquetInputFormat.class, void.class, Msg.class, conf);
rdd.toJavaRDD().foreach(log -> {
System.out.println(log._2);
});
[2] https://github.com/apache/parquet-mr/blob/master/parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoMessageConverter.java#L84
[3] converters[parquetFieldIndex - 1] = new PrimitiveConverter() {};
**Reporter**: [Kristoffer Sjögren](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=deephacks) / @krisskross
**Note**: *This issue was originally created as [PARQUET-697](https://issues.apache.org/jira/browse/PARQUET-697). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoMessageConverter.java の84行目付近にある参照された処理から始め、protobuf クラスに存在しない Parquet フィールドを使って IncompatibleSchemaModificationException を再現してください。既存の変換動作を変更せずに未知のフィールドを例外なしで無視できるようになれば作業は完了です。この issue ではテストファイルは指定されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data-engineering
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100