This is an automated email from the ASF dual-hosted git repository.
laskoviymishka 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 dc09cf00f fix(schema): reject pointer float and double identifiers
(#2592)
dc09cf00f is described below
commit dc09cf00fcdd59caca9d98421693423608d17111
Author: Vu <[email protected]>
AuthorDate: Sun Nov 15 22:11:00 2026 +0100
fix(schema): reject pointer float and double identifiers (#2592)
Signed-off-by: Minh Vu <[email protected]>
Co-authored-by: Minh Vu <[email protected]>
---
schema.go | 2 +-
schema_identifier_fields_validation_test.go | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/schema.go b/schema.go
index ccc38b58a..819de2101 100644
--- a/schema.go
+++ b/schema.go
@@ -138,7 +138,7 @@ func (s *Schema) ValidateIdentifierFields() error {
return fmt.Errorf("%w: identifier field %q must be
required", ErrInvalidSchema, field.Name)
}
switch field.Type.(type) {
- case Float32Type, Float64Type:
+ case Float32Type, Float64Type, *Float32Type, *Float64Type:
return fmt.Errorf("%w: identifier field %q cannot be
float or double", ErrInvalidSchema, field.Name)
}
diff --git a/schema_identifier_fields_validation_test.go
b/schema_identifier_fields_validation_test.go
index 83b9158d3..8698f7662 100644
--- a/schema_identifier_fields_validation_test.go
+++ b/schema_identifier_fields_validation_test.go
@@ -49,6 +49,15 @@ func TestValidateIdentifierFields(t *testing.T) {
{"double", []int{1}, []NestedField{{
ID: 1, Name: "id", Type: PrimitiveTypes.Float64,
Required: true,
}}, "float or double"},
+ {"float pointer", []int{1}, []NestedField{{
+ ID: 1, Name: "id", Type: &Float32Type{}, Required: true,
+ }}, "float or double"},
+ {"double pointer", []int{1}, []NestedField{{
+ ID: 1, Name: "id", Type: &Float64Type{}, Required: true,
+ }}, "float or double"},
+ {"long pointer", []int{1}, []NestedField{{
+ ID: 1, Name: "id", Type: &Int64Type{}, Required: true,
+ }}, ""},
{"struct", []int{1}, []NestedField{{
ID: 1, Name: "id", Type: &StructType{FieldList: nil},
Required: true,
}}, "must be primitive"},