zeroshade commented on code in PR #915:
URL: https://github.com/apache/iceberg-go/pull/915#discussion_r3275534588
##########
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:
> I think its a bit confusing to say that Avro date is needed for
interoperability.
If we're not saying that Avro date is needed for interoperability, then the
spec needs to state that int is allowed but date should be written :smile:
If we're aligned on that, then I'm okay with us being able to read both but
only write date.
--
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]