eneskeles commented on code in PR #2088:
URL: https://github.com/apache/iceberg-go/pull/2088#discussion_r4159167546


##########
literals_test.go:
##########
@@ -1150,6 +1226,55 @@ func TestInvalidBinaryLiteralConversions(t *testing.T) {
        })
 }
 
+func TestInvalidVariantLiteralConversions(t *testing.T) {
+       // null, object and array variants hold no primitive value to convert
+       for _, v := range []any{nil, []any{int64(1)}, map[string]any{"a": 
int64(1)}} {
+               testInvalidLiteralConversions(t, variantLiteralOf(t, v), 
[]iceberg.Type{
+                       iceberg.PrimitiveTypes.Bool,
+                       iceberg.PrimitiveTypes.Int32,
+                       iceberg.PrimitiveTypes.Int64,
+                       iceberg.PrimitiveTypes.Float32,
+                       iceberg.PrimitiveTypes.Float64,
+                       iceberg.PrimitiveTypes.Date,
+                       iceberg.PrimitiveTypes.Time,
+                       iceberg.PrimitiveTypes.Timestamp,
+                       iceberg.PrimitiveTypes.TimestampTz,
+                       iceberg.DecimalTypeOf(9, 2),
+                       iceberg.PrimitiveTypes.String,
+                       iceberg.PrimitiveTypes.UUID,
+                       iceberg.PrimitiveTypes.Binary,
+                       iceberg.FixedTypeOf(2),
+               })
+       }
+
+       // a primitive variant rejects what the literal for its value rejects
+       testInvalidLiteralConversions(t, variantLiteralOf(t, true), 
[]iceberg.Type{
+               iceberg.PrimitiveTypes.Int32,
+               iceberg.PrimitiveTypes.Int64,
+               iceberg.PrimitiveTypes.Float32,
+               iceberg.PrimitiveTypes.Float64,
+               iceberg.PrimitiveTypes.Date,
+               iceberg.PrimitiveTypes.Time,
+               iceberg.PrimitiveTypes.Timestamp,
+               iceberg.PrimitiveTypes.TimestampTz,
+               iceberg.DecimalTypeOf(9, 2),
+               iceberg.PrimitiveTypes.String,
+               iceberg.PrimitiveTypes.UUID,
+               iceberg.PrimitiveTypes.Binary,
+               iceberg.FixedTypeOf(2),
+       })

Review Comment:
   I see, removed these. 



-- 
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]

Reply via email to