@Test public void toTypeSchemaStructTypeNotNullable() throws Exception { Schema schema = AvroUtils.typeFor(DataTypes.createStructType( Lists.newArrayList( DataTypes.createStructField("field1", DataTypes.StringType, false) )), false); assertEquals("Invalid type", Schema.Type.RECORD, schema.getType()); assertEquals("Invalid record name", "record0", schema.getName()); assertEquals("Invalid field count", 1, schema.getFields().size()); assertEquals("Invalid field name", "field1", schema.getFields().get(0).name()); assertEquals("Invalid field type", Schema.Type.STRING, schema.getFields().get(0).schema().getType()); }
public static Schema typeFor(DataType dataType) { return typeFor(dataType, true); }
AvroUtils { public static Schema typeFor(DataType dataType) { return typeFor(dataType, true); } }
AvroUtils { public static Schema typeFor(DataType dataType) { return typeFor(dataType, true); }  }
AvroUtils { public static Schema typeFor(DataType dataType) { return typeFor(dataType, true); }  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 typeFor(DataType dataType) { return typeFor(dataType, true); }  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);  }