Skip to content

Commit bccc14a

Browse files
Remove schema round trip test for unions (the main union vector implementation needs revising)
1 parent 0eb69a3 commit bccc14a

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

adapter/avro/src/test/java/org/apache/arrow/adapter/avro/RoundTripSchemaTest.java

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -513,97 +513,4 @@ public void testRoundTripStructType() {
513513
// Compare string representations - equality not defined for logical types
514514
assertEquals(fields.toString(), arrowSchema.getFields().toString());
515515
}
516-
517-
@Test
518-
public void testRoundTripUnionType() {
519-
520-
AvroToArrowConfig config = new AvroToArrowConfig(null, 1, null, Collections.emptySet(), true);
521-
522-
List<Field> fields =
523-
Arrays.asList(
524-
new Field(
525-
"sparseUnionField",
526-
FieldType.nullable(
527-
new ArrowType.Union(
528-
UnionMode.Sparse,
529-
new int[] {
530-
ArrowType.ArrowTypeID.Int.getFlatbufID(),
531-
ArrowType.ArrowTypeID.FloatingPoint.getFlatbufID(),
532-
ArrowType.ArrowTypeID.Utf8.getFlatbufID()
533-
})),
534-
Arrays.asList(
535-
new Field(
536-
"intMember", FieldType.notNullable(new ArrowType.Int(32, true)), null),
537-
new Field(
538-
"floatMember",
539-
FieldType.notNullable(
540-
new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
541-
null),
542-
new Field("stringMember", FieldType.notNullable(new ArrowType.Utf8()), null))),
543-
new Field(
544-
"denseUnionField",
545-
FieldType.nullable(
546-
new ArrowType.Union(
547-
UnionMode.Dense,
548-
new int[] {
549-
ArrowType.ArrowTypeID.Int.getFlatbufID(),
550-
ArrowType.ArrowTypeID.FloatingPoint.getFlatbufID(),
551-
ArrowType.ArrowTypeID.Utf8.getFlatbufID()
552-
})),
553-
Arrays.asList(
554-
new Field(
555-
"intMember", FieldType.notNullable(new ArrowType.Int(32, true)), null),
556-
new Field(
557-
"floatMember",
558-
FieldType.notNullable(
559-
new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
560-
null),
561-
new Field("stringMember", FieldType.notNullable(new ArrowType.Utf8()), null))),
562-
new Field(
563-
"nullableSparseUnionField",
564-
FieldType.nullable(
565-
new ArrowType.Union(
566-
UnionMode.Sparse,
567-
new int[] {
568-
ArrowType.ArrowTypeID.Int.getFlatbufID(),
569-
ArrowType.ArrowTypeID.FloatingPoint.getFlatbufID(),
570-
ArrowType.ArrowTypeID.Utf8.getFlatbufID()
571-
})),
572-
Arrays.asList(
573-
new Field(
574-
"nullableIntMember", FieldType.nullable(new ArrowType.Int(32, true)), null),
575-
new Field(
576-
"nullableFloatMember",
577-
FieldType.nullable(
578-
new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
579-
null),
580-
new Field(
581-
"nullableStringMember", FieldType.nullable(new ArrowType.Utf8()), null))),
582-
new Field(
583-
"nullableDenseUnionField",
584-
FieldType.nullable(
585-
new ArrowType.Union(
586-
UnionMode.Dense,
587-
new int[] {
588-
ArrowType.ArrowTypeID.Int.getFlatbufID(),
589-
ArrowType.ArrowTypeID.FloatingPoint.getFlatbufID(),
590-
ArrowType.ArrowTypeID.Utf8.getFlatbufID()
591-
})),
592-
Arrays.asList(
593-
new Field(
594-
"nullableIntMember", FieldType.nullable(new ArrowType.Int(32, true)), null),
595-
new Field(
596-
"nullableFloatMember",
597-
FieldType.nullable(
598-
new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)),
599-
null),
600-
new Field(
601-
"nullableStringMember", FieldType.nullable(new ArrowType.Utf8()), null))));
602-
603-
Schema avroSchema = ArrowToAvroUtils.createAvroSchema(fields, "TestRecord");
604-
org.apache.arrow.vector.types.pojo.Schema arrowSchema = AvroToArrowUtils.createArrowSchema(avroSchema, config);
605-
606-
// Compare string representations - equality not defined for logical types
607-
assertEquals(fields.toString(), arrowSchema.getFields().toString());
608-
}
609516
}

0 commit comments

Comments
 (0)