RussellSpitzer commented on code in PR #17424:
URL: https://github.com/apache/iceberg/pull/17424#discussion_r3679299881
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestVariantShreddingAnalyzer.java:
##########
@@ -471,6 +469,112 @@ public void testUuidFieldIsTrackedAndShredded() {
.isInstanceOf(LogicalTypeAnnotation.UUIDLogicalTypeAnnotation.class);
}
+ @Test
+ public void testMixedPrimitiveTypesFieldNotShredded() {
+ VariantMetadata meta = Variants.metadata("mixed", "keep");
+ ShreddedObject row1 = Variants.object(meta);
+ row1.put("mixed", Variants.of(42));
+ row1.put("keep", Variants.of(1));
+ ShreddedObject row2 = Variants.object(meta);
+ row2.put("mixed", Variants.of("text"));
+ row2.put("keep", Variants.of(2));
+
+ DirectAnalyzer analyzer = new DirectAnalyzer();
+ Type schema = analyzer.analyzeAndCreateSchema(List.of(row1, row2), 0);
+
+ assertThat(schema).isNotNull().isInstanceOf(GroupType.class);
+ GroupType typedValue = (GroupType) schema;
+ assertThat(typedValue.containsField("mixed")).isFalse();
+ assertThat(typedValue.containsField("keep")).isTrue();
+ }
+
+ @Test
+ public void testIntegerWideningAdmitsField() {
Review Comment:
Where is the testDecimalWideningAdmitsField() :)
--
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]