Skip to content

Expanded the metadata fields supported in the AMQP input#39

Merged
Jeffail merged 5 commits into
redpanda-data:masterfrom
chrisriley:amqp-input-meta
Jul 29, 2018
Merged

Expanded the metadata fields supported in the AMQP input#39
Jeffail merged 5 commits into
redpanda-data:masterfrom
chrisriley:amqp-input-meta

Conversation

@chrisriley
Copy link
Copy Markdown
Contributor

This PR expands AMQP input metadata functionality to include all fields in the amqp.Delivery struct with the exception of Acknowledger and MessageCount. It also adds support for all types supported by amqp.Table and includes support for nested amqp.Table structs.

I created a gist that demonstrates these additions.

-Chris

@Jeffail Jeffail self-assigned this Jul 29, 2018
@Jeffail
Copy link
Copy Markdown
Contributor

Jeffail commented Jul 29, 2018

Hey @chrisriley, looks great. I'm just playing with the changes locally. I think I might take away the prefix for headers, the intention there is to make a best attempt at passing the unchanged preexisting metadata to sinks.

A general rule I'm leaning towards right now is any specific headers/metadata fields that are taken from a message we try to copy as-is (obviously here you do a best attempt by walking recursive header tables, which I like), but things we extract that aren't explicitly metadata or headers (such as the key, timestamps, etc) we prefix so that they can be easily distinguished.

@Jeffail Jeffail merged commit 3deb7c2 into redpanda-data:master Jul 29, 2018
Jeffail added a commit that referenced this pull request May 14, 2026
Picks up two upstream landings from the rolling-fix work:

  1. twmb/avro PR #38 (Jeffail) — the field-level logicalType lift our
     own metadata parser already handles. Pulling it in means the
     value-side decoder now produces time.Time for sibling-form
     timestamp-millis (and the rest of the matrix) natively, instead
     of returning int64 and relying on the iceberg shredder's
     metadata-driven numeric scaling bridge to reconcile.

  2. twmb/avro PR #39 (twmb) — a cumulative perf, parity, and
     spec-compliance pass. Includes "decimal precision/scale, spec
     form" which changes how decimal-typed values serialise under
     EncodeJSON: a scale-2 value 0.33 (wire bytes 0x21) now emits as
     the codepoint-mapped string "!" rather than the numeric 0.33,
     matching Java's JsonEncoder output.

The shredder coerce bridge in iceberg/shredder/temporal.go stays —
it's now a safety net rather than load-bearing infrastructure. The
metadata-side fix in confluent/ecs_avro.go also stays because it
parses schemas into schema.Common independently of twmb (the iceberg
output's schema_metadata path uses Common, not twmb's schemaNode).

Coverage:
  - TestUpstreamTwmbHonoursSiblingFormLogicalType (new): pins the
    upstream PR #38 behaviour by asserting that sibling-form schemas
    decode to time.Time end-to-end. If twmb ever regresses on this,
    the test surfaces it in the package that depends on the contract.

  - TestSchemaRegistryDecodeAvro / TestSchemaRegistryDecodeAvroRawJson:
    pos_0_33333333 default-mode expectation updated from `0.33` to
    `"!"` per the spec form. Preserved-mode expectation unchanged —
    our preserveLogicalTypeOpts decimal CustomType still produces
    json.Number, which the SetStructuredMut path preserves through
    Go's json.Marshal.

CHANGELOG: a "Changed (potentially breaking)" entry documents the
decimal serialisation shape change for default-mode users and points
at preserve_logical_types: true as the migration knob.
Jeffail added a commit that referenced this pull request May 14, 2026
Picks up two upstream landings from the rolling-fix work:

  1. twmb/avro PR #38 (Jeffail) — the field-level logicalType lift our
     own metadata parser already handles. Pulling it in means the
     value-side decoder now produces time.Time for sibling-form
     timestamp-millis (and the rest of the matrix) natively, instead
     of returning int64 and relying on the iceberg shredder's
     metadata-driven numeric scaling bridge to reconcile.

  2. twmb/avro PR #39 (twmb) — a cumulative perf, parity, and
     spec-compliance pass. Includes "decimal precision/scale, spec
     form" which changes how decimal-typed values serialise under
     EncodeJSON: a scale-2 value 0.33 (wire bytes 0x21) now emits as
     the codepoint-mapped string "!" rather than the numeric 0.33,
     matching Java's JsonEncoder output.

The shredder coerce bridge in iceberg/shredder/temporal.go stays —
it's now a safety net rather than load-bearing infrastructure. The
metadata-side fix in confluent/ecs_avro.go also stays because it
parses schemas into schema.Common independently of twmb (the iceberg
output's schema_metadata path uses Common, not twmb's schemaNode).

Coverage:
  - TestUpstreamTwmbHonoursSiblingFormLogicalType (new): pins the
    upstream PR #38 behaviour by asserting that sibling-form schemas
    decode to time.Time end-to-end. If twmb ever regresses on this,
    the test surfaces it in the package that depends on the contract.

  - TestSchemaRegistryDecodeAvro / TestSchemaRegistryDecodeAvroRawJson:
    pos_0_33333333 default-mode expectation updated from `0.33` to
    `"!"` per the spec form. Preserved-mode expectation unchanged —
    our preserveLogicalTypeOpts decimal CustomType still produces
    json.Number, which the SetStructuredMut path preserves through
    Go's json.Marshal.

CHANGELOG: a "Changed (potentially breaking)" entry documents the
decimal serialisation shape change for default-mode users and points
at preserve_logical_types: true as the migration knob.
Jeffail added a commit that referenced this pull request May 18, 2026
Picks up two upstream landings from the rolling-fix work:

  1. twmb/avro PR #38 (Jeffail) — the field-level logicalType lift our
     own metadata parser already handles. Pulling it in means the
     value-side decoder now produces time.Time for sibling-form
     timestamp-millis (and the rest of the matrix) natively, instead
     of returning int64 and relying on the iceberg shredder's
     metadata-driven numeric scaling bridge to reconcile.

  2. twmb/avro PR #39 (twmb) — a cumulative perf, parity, and
     spec-compliance pass. Includes "decimal precision/scale, spec
     form" which changes how decimal-typed values serialise under
     EncodeJSON: a scale-2 value 0.33 (wire bytes 0x21) now emits as
     the codepoint-mapped string "!" rather than the numeric 0.33,
     matching Java's JsonEncoder output.

The shredder coerce bridge in iceberg/shredder/temporal.go stays —
it's now a safety net rather than load-bearing infrastructure. The
metadata-side fix in confluent/ecs_avro.go also stays because it
parses schemas into schema.Common independently of twmb (the iceberg
output's schema_metadata path uses Common, not twmb's schemaNode).

Coverage:
  - TestUpstreamTwmbHonoursSiblingFormLogicalType (new): pins the
    upstream PR #38 behaviour by asserting that sibling-form schemas
    decode to time.Time end-to-end. If twmb ever regresses on this,
    the test surfaces it in the package that depends on the contract.

  - TestSchemaRegistryDecodeAvro / TestSchemaRegistryDecodeAvroRawJson:
    pos_0_33333333 default-mode expectation updated from `0.33` to
    `"!"` per the spec form. Preserved-mode expectation unchanged —
    our preserveLogicalTypeOpts decimal CustomType still produces
    json.Number, which the SetStructuredMut path preserves through
    Go's json.Marshal.

CHANGELOG: a "Changed (potentially breaking)" entry documents the
decimal serialisation shape change for default-mode users and points
at preserve_logical_types: true as the migration knob.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants