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 0cbb5affc test(table): build nested types with constructors in dict
col tests (#2706)
0cbb5affc is described below
commit 0cbb5affc36f116204f44b982df4d2d132029729
Author: Andrei Tserakhau <[email protected]>
AuthorDate: Wed Nov 25 17:05:41 2026 +0100
test(table): build nested types with constructors in dict col tests (#2706)
test(table): build nested types with constructors in dictionary column tests
landed just before it with new tests in scan_dictionary_columns_test.go that
build those types as struct literals. Each PR was green on its own, but
together they stop the table package tests from compiling, so Go, Go
Integration and Audit and Verify have all been failing on main since
b1fa4e35.
Switch the literals to NewStructType, NewListType and NewMapType. The
required flags stay false, the same as the zero values the literals had,
so the schemas under test don't change.
---
table/scan_dictionary_columns_test.go | 40 +++++++++++++++++------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/table/scan_dictionary_columns_test.go
b/table/scan_dictionary_columns_test.go
index d29064084..45168c214 100644
--- a/table/scan_dictionary_columns_test.go
+++ b/table/scan_dictionary_columns_test.go
@@ -186,13 +186,13 @@ func TestWithDictionaryColumnsReturnsDictionaries(t
*testing.T) {
// parents of the requested nested leaves.
tx := tbl.NewTransaction()
require.NoError(t, tx.UpdateSchema(true, false).
- AddColumn([]string{"st"}, &iceberg.StructType{FieldList:
[]iceberg.NestedField{
- {ID: 1, Name: "x", Type: iceberg.PrimitiveTypes.String},
- }}, "", false, nil).
- AddColumn([]string{"l"}, &iceberg.ListType{ElementID: 1,
Element: iceberg.PrimitiveTypes.String}, "", false, nil).
- AddColumn([]string{"m"}, &iceberg.MapType{
- KeyID: 1, KeyType: iceberg.PrimitiveTypes.String,
ValueID: 2, ValueType: iceberg.PrimitiveTypes.String,
- }, "", false, nil).
+ AddColumn([]string{"st"}, iceberg.NewStructType(
+ iceberg.NestedField{ID: 1, Name: "x", Type:
iceberg.PrimitiveTypes.String},
+ ), "", false, nil).
+ AddColumn([]string{"l"}, iceberg.NewListType(1,
iceberg.PrimitiveTypes.String, false), "", false, nil).
+ AddColumn([]string{"m"}, iceberg.NewMapType(
+ 1, iceberg.PrimitiveTypes.String, 2,
iceberg.PrimitiveTypes.String, false,
+ ), "", false, nil).
Commit())
tbl, err := tx.Commit(t.Context())
require.NoError(t, err)
@@ -313,13 +313,13 @@ func TestWithDictionaryColumnsReadsParquetDictionaries(t
*testing.T) {
schema := iceberg.NewSchema(0,
iceberg.NestedField{ID: 1, Name: "id", Type:
iceberg.PrimitiveTypes.Int64, Required: true},
iceberg.NestedField{ID: 2, Name: "s", Type:
iceberg.PrimitiveTypes.String},
- iceberg.NestedField{ID: 3, Name: "st", Type:
&iceberg.StructType{FieldList: []iceberg.NestedField{
- {ID: 5, Name: "x", Type:
iceberg.PrimitiveTypes.String},
- }}},
- iceberg.NestedField{ID: 4, Name: "l", Type:
&iceberg.ListType{ElementID: 6, Element: iceberg.PrimitiveTypes.String}},
- iceberg.NestedField{ID: 7, Name: "m", Type:
&iceberg.MapType{
- KeyID: 8, KeyType:
iceberg.PrimitiveTypes.String, ValueID: 9, ValueType:
iceberg.PrimitiveTypes.String,
- }},
+ iceberg.NestedField{ID: 3, Name: "st", Type:
iceberg.NewStructType(
+ iceberg.NestedField{ID: 5, Name: "x", Type:
iceberg.PrimitiveTypes.String},
+ )},
+ iceberg.NestedField{ID: 4, Name: "l", Type:
iceberg.NewListType(6, iceberg.PrimitiveTypes.String, false)},
+ iceberg.NestedField{ID: 7, Name: "m", Type:
iceberg.NewMapType(
+ 8, iceberg.PrimitiveTypes.String, 9,
iceberg.PrimitiveTypes.String, false,
+ )},
)
tbl := newDictionaryColumnsTable(t, schema, iceberg.Properties{
table.ParquetRowGroupLimitKey: "2",
@@ -441,9 +441,9 @@ func TestWithDictionaryColumnsValidation(t *testing.T) {
}
func TestWithDictionaryColumnsDeletes(t *testing.T) {
- st := iceberg.NestedField{ID: 4, Name: "st", Type:
&iceberg.StructType{FieldList: []iceberg.NestedField{
- {ID: 5, Name: "x", Type: iceberg.PrimitiveTypes.String},
- }}}
+ st := iceberg.NestedField{ID: 4, Name: "st", Type:
iceberg.NewStructType(
+ iceberg.NestedField{ID: 5, Name: "x", Type:
iceberg.PrimitiveTypes.String},
+ )}
s := iceberg.NestedField{ID: 2, Name: "s", Type:
iceberg.PrimitiveTypes.String}
b := iceberg.NestedField{ID: 3, Name: "b", Type:
iceberg.PrimitiveTypes.Binary}
schema := iceberg.NewSchema(0,
@@ -567,9 +567,9 @@ func TestWithDictionaryColumnsRowFilters(t *testing.T) {
iceberg.NestedField{ID: 1, Name: "id", Type:
iceberg.PrimitiveTypes.Int64, Required: true},
iceberg.NestedField{ID: 2, Name: "s", Type:
iceberg.PrimitiveTypes.String},
iceberg.NestedField{ID: 3, Name: "b", Type:
iceberg.PrimitiveTypes.Binary},
- iceberg.NestedField{ID: 4, Name: "st", Type:
&iceberg.StructType{FieldList: []iceberg.NestedField{
- {ID: 5, Name: "x", Type: iceberg.PrimitiveTypes.String},
- }}},
+ iceberg.NestedField{ID: 4, Name: "st", Type:
iceberg.NewStructType(
+ iceberg.NestedField{ID: 5, Name: "x", Type:
iceberg.PrimitiveTypes.String},
+ )},
)
tbl := newDictionaryColumnsTable(t, schema, nil)
// b holds base64 in JSON: eA== x, eQ== y.