Gang Wu created AVRO-4351:
-----------------------------

             Summary: [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


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)

Reply via email to