@Test public void toTypeSchemaMapContainsNull() throws Exception { Schema schema = AvroUtils.typeFor(DataTypes.createMapType(DataTypes.StringType, DataTypes.IntegerType, true),false); assertEquals("Invalid type", Schema.Type.MAP, schema.getType()); assertEquals("Invalid value type", Schema.Type.UNION, schema.getValueType().getType()); assertEquals("Invalid union count", 2, schema.getValueType().getTypes().size()); for (Schema s : schema.getValueType().getTypes()) { assertThat("Invalid union types", s.getType(), anyOf(is(Schema.Type.INT), is(Schema.Type.NULL))); } }
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);  }