[
https://issues.apache.org/jira/browse/AVRO-4351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117714#comment-18117714
]
ASF subversion and git services commented on AVRO-4351:
-------------------------------------------------------
Commit 209a3735ec330679790824da54b7558db55e4e7f in avro's branch
refs/heads/main from Gang Wu
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=209a3735ec ]
AVRO-4351: [C++] Preserve primitive custom attributes (#4001)
Preserve unknown properties when parsing and serializing primitive
schema objects. This keeps extensions such as Iceberg's adjust-to-utc
annotation intact across schema JSON round trips.
> [C++] Preserve custom attributes on primitive schemas during JSON round-trip
> ----------------------------------------------------------------------------
>
> Key: AVRO-4351
> URL: https://issues.apache.org/jira/browse/AVRO-4351
> Project: Apache Avro
> Issue Type: Bug
> Components: c++
> Reporter: Gang Wu
> Assignee: Gang Wu
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Avro C++ does not currently preserve custom attributes attached directly to
> primitive schema objects during a JSON schema round-trip.
> For example:
>
> {code:java}
> {
> "type": "long",
> "logicalType": "timestamp-micros",
> "adjust-to-utc": true
> }
> {code}
> The schema compiler ignores unknown properties on primitive schema objects,
> and
> NodePrimitive::printJson does not serialize primitive custom attributes. As a
> result, adjust-to-utc and other custom properties are lost after parsing or
> serializing the schema.
> This affects integrations that rely on Avro schema properties. In particular,
> the Iceberg Avro serialization rules use adjust-to-utc to distinguish
> timestamp
> from timestamptz while representing both as long with the timestamp-micros
> logical type. Losing this property can cause timestamptz to be interpreted as
> timestamp.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)