@Test public void validUnionInMap() throws SchemaValidationException { Schema union = SchemaBuilder.unionOf().intType().and().nullType().endUnion(); Schema map = SchemaBuilder.map().values(union); Schema schema = SchemaBuilder.record("r").fields().name("f").type(map).noDefault().endRecord(); DataHighwaySchemaValidator.validate(schema, DISALLOW_NON_NULLABLE_UNIONS); }
public static void validate(Schema schema, UnionRule unionRule) throws SchemaValidationException { validateIsRecord(schema); validateDoesNotContainReservedColumnName(schema); validateObfuscationAnnotations(schema); validateLogicalTypes(schema); SchemaValidator.validate(schema); if (DISALLOW_NON_NULLABLE_UNIONS == unionRule) { validateNonNullableUnions(schema); } }
DataHighwaySchemaValidator { public static void validate(Schema schema, UnionRule unionRule) throws SchemaValidationException { validateIsRecord(schema); validateDoesNotContainReservedColumnName(schema); validateObfuscationAnnotations(schema); validateLogicalTypes(schema); SchemaValidator.validate(schema); if (DISALLOW_NON_NULLABLE_UNIONS == unionRule) { validateNonNullableUnions(schema); } } }
DataHighwaySchemaValidator { public static void validate(Schema schema, UnionRule unionRule) throws SchemaValidationException { validateIsRecord(schema); validateDoesNotContainReservedColumnName(schema); validateObfuscationAnnotations(schema); validateLogicalTypes(schema); SchemaValidator.validate(schema); if (DISALLOW_NON_NULLABLE_UNIONS == unionRule) { validateNonNullableUnions(schema); } } private  DataHighwaySchemaValidator(); }
DataHighwaySchemaValidator { public static void validate(Schema schema, UnionRule unionRule) throws SchemaValidationException { validateIsRecord(schema); validateDoesNotContainReservedColumnName(schema); validateObfuscationAnnotations(schema); validateLogicalTypes(schema); SchemaValidator.validate(schema); if (DISALLOW_NON_NULLABLE_UNIONS == unionRule) { validateNonNullableUnions(schema); } } private  DataHighwaySchemaValidator(); static boolean isValid(Schema schema, UnionRule unionRule); static void validate(Schema schema, UnionRule unionRule); }
DataHighwaySchemaValidator { public static void validate(Schema schema, UnionRule unionRule) throws SchemaValidationException { validateIsRecord(schema); validateDoesNotContainReservedColumnName(schema); validateObfuscationAnnotations(schema); validateLogicalTypes(schema); SchemaValidator.validate(schema); if (DISALLOW_NON_NULLABLE_UNIONS == unionRule) { validateNonNullableUnions(schema); } } private  DataHighwaySchemaValidator(); static boolean isValid(Schema schema, UnionRule unionRule); static void validate(Schema schema, UnionRule unionRule);  }