CLI-3553: Avro JSON Encoding Union Type Fails to Decode
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
提供された Avro スキーマとサンプルレコードで失敗を再現し、Confluent Schema Registry コンテナ内の /usr/bin/kafka-avro-console-producer と CLI を比較します。CLI の JSON エンコードされた Avro デコードパスを追跡し、timestamp union の値が Avro JSON エンコード仕様に従い、報告されたエラーを発生させないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
When attempting to write records to Confluent Cloud using the CLI, we sometimes get errors related JSON Encoded Avro records that deal with union types.
According to the JSON Encoding spec from Avro, when using a union type
- if its type is null, then it is encoded as a JSON null;
- otherwise it is encoded as a JSON object with one name/value pair whose name is the type’s name and whose value is the recursively encoded value. For Avro’s named types (record, fixed or enum) the user-specified name is used, for other types the type name is used.
We can do this locally using the included /usr/bin/kafka-avro-console-producer inside of the CP Schema Registry docker container, but not using the CLI. Instead, we get
Error: cannot decode textual record "<record-namespace>.<record-name>": cannot decode textual union: cannot decode textual map: cannot determine codec: "<type>" for key: "<field-name>"
Below is the full schema (with some sensitive bits removed) and the sample record we are using
{
"type" : "record",
"name" : "Updated",
"namespace" : "namespace",
"doc" : "Updated Event",
"fields" : [ {
"name" : "subjectivity_id",
"type" : {
"type" : "string",
"logicalType" : "string"
},
"doc" : "Identifier"
}, {
"name" : "topic",
"type" : "string",
"doc" : "Topic name"
}, {
"name" : "created_at",
"type" : [ "null", {
"type" : "long",
"logicalType" : "timestamp-millis"
} ],
"doc" : "Date indicating when the record was created",
"default" : null
}, {
"name" : "updated_at",
"type" : [ "null", {
"type" : "long",
"logicalType" : "timestamp-millis"
} ],
"doc" : "Date indicating when the record was updated",
"default" : null
}]
}
{ "subjectivity_id": "subj-1234","topic": "subjectivity_updated","created_at": null,"updated_at": { "long": 1696613296 }}
Let me know what other data we can provide!
- 主要言語
- Go
- スター
- 82
- フォーク
- 37
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
confluentinc/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
confluentinc/cli#3568 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
confluentinc/cli#3585 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
confluentinc/cli#3147 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
confluentinc/cli#3072 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
confluentinc/cli#3056 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
confluentinc/cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
bug triage/pending
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
core enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
forgelab-dev/lfa-forgenet#109 ·
メンテナーはふだん 1 日以内に返信
-
[mesheryctl] Enforce maximum positional argument bounds in system context view to prevent silent argument discarding対応中かも @madhavzanwar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
meshery/meshery#24055 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信