@Test public void toSchemaArraysNested() throws Exception { StructType input = DataTypes.createStructType(Lists.newArrayList( DataTypes.createStructField("Outer", DataTypes.createArrayType( DataTypes.createArrayType(DataTypes.IntegerType, false), false), false) )); Schema schema = AvroUtils.schemaFor(input); assertEquals("Invalid field count", 1, schema.getFields().size()); assertEquals("Invalid field name", "Outer", schema.getFields().get(0).name()); assertEquals("Invalid field type", Schema.Type.ARRAY, schema.getFields().get(0).schema().getType()); assertEquals("Invalid outer element type, i.e the inner type", Schema.Type.ARRAY, schema.getFields().get(0).schema().getElementType().getType()); assertEquals("Invalid inner element type", Schema.Type.INT, schema.getFields().get(0).schema().getElementType().getElementType().getType()); }
public static Schema schemaFor(StructType structType) { return schemaFor(structType, null, null); }
AvroUtils { public static Schema schemaFor(StructType structType) { return schemaFor(structType, null, null); } }
AvroUtils { public static Schema schemaFor(StructType structType) { return schemaFor(structType, null, null); }  }
AvroUtils { public static Schema schemaFor(StructType structType) { return schemaFor(structType, null, null); }  static Schema schemaFor(StructType structType); static Schema schemaFor(StructType structType, String record, String namespace); static Schema typeFor(DataType dataType); static Schema typeFor(DataType dataType, boolean isOptional); static StructType structTypeFor(Schema schema); static DataType dataTypeFor(Schema schemaType); }
AvroUtils { public static Schema schemaFor(StructType structType) { return schemaFor(structType, null, null); }  static Schema schemaFor(StructType structType); static Schema schemaFor(StructType structType, String record, String namespace); static Schema typeFor(DataType dataType); static Schema typeFor(DataType dataType, boolean isOptional); static StructType structTypeFor(Schema schema); static DataType dataTypeFor(Schema schemaType);  }