/** * Creates a MapType by specifying the data type of keys ({@code keyType}) and values * ({@code keyType}). The field of {@code valueContainsNull} is set to {@code true}. */ public static MapType createMapType(DataType keyType, DataType valueType) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, true); }
/** * Creates a MapType by specifying the data type of keys ({@code keyType}) and values * ({@code keyType}). The field of {@code valueContainsNull} is set to {@code true}. */ public static MapType createMapType(DataType keyType, DataType valueType) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, true); }
/** * Creates a MapType by specifying the data type of keys ({@code keyType}) and values * ({@code keyType}). The field of {@code valueContainsNull} is set to {@code true}. */ public static MapType createMapType(DataType keyType, DataType valueType) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, true); }
/** * Creates a MapType by specifying the data type of keys ({@code keyType}), the data type of * values ({@code keyType}), and whether values contain any null value * ({@code valueContainsNull}). */ public static MapType createMapType( DataType keyType, DataType valueType, boolean valueContainsNull) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, valueContainsNull); }
/** * Creates a MapType by specifying the data type of keys ({@code keyType}), the data type of * values ({@code keyType}), and whether values contain any null value * ({@code valueContainsNull}). */ public static MapType createMapType( DataType keyType, DataType valueType, boolean valueContainsNull) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, valueContainsNull); }
/** * Creates a MapType by specifying the data type of keys ({@code keyType}), the data type of * values ({@code keyType}), and whether values contain any null value * ({@code valueContainsNull}). */ public static MapType createMapType( DataType keyType, DataType valueType, boolean valueContainsNull) { if (keyType == null) { throw new IllegalArgumentException("keyType should not be null."); } if (valueType == null) { throw new IllegalArgumentException("valueType should not be null."); } return new MapType(keyType, valueType, valueContainsNull); }
schema.apply("b")); ArrayType valueType = new ArrayType(DataTypes.IntegerType, false); MapType mapType = new MapType(DataTypes.StringType, valueType, true); Assert.assertEquals( new StructField("c", mapType, true, Metadata.empty()),
schema.apply("b")); ArrayType valueType = new ArrayType(DataTypes.IntegerType, false); MapType mapType = new MapType(DataTypes.StringType, valueType, true); Assert.assertEquals( new StructField("c", mapType, true, Metadata.empty()),
schema.apply("b")); ArrayType valueType = new ArrayType(DataTypes.IntegerType, false); MapType mapType = new MapType(DataTypes.StringType, valueType, true); Assert.assertEquals( new StructField("c", mapType, true, Metadata.empty()),