You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ze...@apache.org on 2026/09/24 17:04:52 UTC

(iceberg-go) branch main updated: fix(codec): nanosecond timestamp partitions in schema fingerprint (#2052)

This is an automated email from the ASF dual-hosted git repository.

zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 85121cbde fix(codec): nanosecond timestamp partitions in schema fingerprint (#2052)
85121cbde is described below

commit 85121cbde006091263c8035b90bd76a34b3d7460
Author: Andrei Tserakhau <la...@gmail.com>
AuthorDate: Thu Sep 24 19:04:46 2026 +0200

    fix(codec): nanosecond timestamp partitions in schema fingerprint (#2052)
    
    fix(codec): support nanosecond timestamp partitions in schema fingerprint
    
    `manifestEntrySchemaFor` rejected `timestamp_ns` / `timestamptz_ns` partition types because `writePartitionTypeFingerprint` was missing the cases already supported by `partitionTypeToAvroSchema`.
    
    Add both fingerprint cases and update the invalid-type test. Existing fingerprint/Avro parity coverage now keeps the two paths in sync.
---
 data_file_codec.go      | 4 ++++
 data_file_codec_test.go | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/data_file_codec.go b/data_file_codec.go
index 41445834f..dcd01d952 100644
--- a/data_file_codec.go
+++ b/data_file_codec.go
@@ -386,6 +386,10 @@ func writePartitionTypeFingerprint(key *strings.Builder, typ Type) error {
 		key.WriteByte('t')
 	case TimestampTzType:
 		key.WriteByte('z')
+	case TimestampNsType:
+		key.WriteByte('n')
+	case TimestampTzNsType:
+		key.WriteByte('N')
 	case UUIDType:
 		key.WriteByte('u')
 	case BooleanType:
diff --git a/data_file_codec_test.go b/data_file_codec_test.go
index fc42558ee..7ca765849 100644
--- a/data_file_codec_test.go
+++ b/data_file_codec_test.go
@@ -464,8 +464,6 @@ func TestManifestEntrySchemaForRejectsInvalidTypesAfterCacheHit(t *testing.T) {
 
 	for _, typ := range []Type{
 		unsupportedCodecPartitionType{},
-		TimestampNsType{},
-		TimestampTzNsType{},
 		VariantType{},
 		&StructType{}, &ListType{ElementID: 2, Element: Int64Type{}},
 		&MapType{KeyID: 2, KeyType: StringType{}, ValueID: 3, ValueType: Int64Type{}},