kevinjqliu commented on code in PR #915:
URL: https://github.com/apache/iceberg-go/pull/915#discussion_r3275349298
##########
schema_conversions_test.go:
##########
@@ -196,3 +197,73 @@ func TestPartitionTypeToAvroSchemaDuplicateNamedTypes(t
*testing.T) {
})
}
}
+
+// TestDayTransformPartitionAvroDateEncoding verifies that a day(ts) partition
+// field is encoded with the Avro "date" logical type, not as a plain integer.
+// This is required for interoperability with Trino, Spark, and other Iceberg
+// engines that reject manifests where day-partition columns lack the date
type.
+//
+// The fix lives in PartitionSpec.PartitionType: it overrides DayTransform's
+// ResultType (Int32) to DateType so the existing DateType branch in
+// partitionTypeToAvroSchema emits DateNode automatically.
Review Comment:
slight nit here, i think the problem is the iceberg-go implementation not
being able to read Avro date (written by iceberg-rust during compaction)
Other engines (Trino/Spark) and implementations (java/python/rust) can read
both Avro int and Avro date, but choose to only write Avro date.
I think its a bit confusing to say that Avro date is needed for
interoperability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]