SchemaEvolutionValidation implements ValidateInterface<Schema> { @Override public void check(Schema nextSchema) throws AbstractValidationException { new SchemaValidation().check(nextSchema); List<Table> tablesInCurrentSchema = currentSchema.getTableList(); List<Table> tablesInNextSchema = nextSchema.getTableList(); for (Table cur : tablesInCurrentSchema) { boolean found = false; for (Table next : tablesInNextSchema) { if (cur.getName().equals(next.getName())) { checkTable(cur, next); found = true; break; } } if (!found) { LOG.warn("A table is removed - " + cur.getName()); } } } SchemaEvolutionValidation(Schema curSchema); @Override void check(Schema nextSchema);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void checkNextSchema() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true, \"isDesSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldDeletionInSchemaEvolutionException.class) public void checkFieldSchema() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true, \"isDesSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldTypeModifiedInSchemaEvolutionException.class) public void checkFieldTypeChangedSchema() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Long\", \"isRequired\": true, \"isDesSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldDefaultValueModifiedInSchemaEvolutionException.class) public void checkFieldDefaultValueChangedSchema() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true, \"isDesSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"11\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldConstraintModifiedInSchemaEvolutionException.class) public void checkFieldConstraintChangedSchema1() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true, \"isAscSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldConstraintModifiedInSchemaEvolutionException.class) public void checkFieldConstraintChangedSchema2() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\", \"isRequired\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true, \"isDesSortKey\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }
@Test(expectedExceptions = FieldConstraintModifiedInSchemaEvolutionException.class) public void checkFieldConstraintChangedSchema3() throws AbstractValidationException { final String json_schema = "{\r\n" + " \"schema\": \"simple_schema\",\r\n" + " \"table_list\": [\r\n" + " {\r\n" + " \"table\": \"second_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1,\"name\": \"byte_required_column\", \"type\": \"Byte\", \"isRequired\": true},\r\n" + " {\"id\": 2,\"name\": \"boolean_list_column\", \"type\": \"List:Boolean\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"first_level_nested_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"int_required_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 2, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"struct_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"nested_table_column\", \"type\": \"List:second_level_nested_table\"}\r\n" + " ]\r\n" + " },\r\n" + " {\r\n" + " \"table\": \"main_table\",\r\n" + " \"fields\": [\r\n" + " {\"id\": 1, \"name\": \"long_required_column\", \"type\": \"Long\", \"isRequired\": true, \"isFrequentlyUsed\": true},\r\n" + " {\"id\": 2, \"name\": \"int_sorted_column\", \"type\": \"Integer\", \"isRequired\": true},\r\n" + " {\"id\": 3, \"name\": \"byte_column\", \"type\": \"Byte\", \"default\": \"-1\"},\r\n" + " {\"id\": 4, \"name\": \"boolean_column\", \"type\": \"Boolean\", \"default\": \"false\"},\r\n" + " {\"id\": 5, \"name\": \"short_column\", \"type\": \"Short\", \"default\": \"0\"},\r\n" + " {\"id\": 6, \"name\": \"float_column\", \"type\": \"Float\", \"default\": \"0.0\"},\r\n" + " {\"id\": 7, \"name\": \"double_column\", \"type\": \"Double\", \"default\": \"0.001\"},\r\n" + " {\"id\": 8, \"name\": \"string_column\", \"type\": \"String\", \"default\": \"Unknown\"},\r\n" + " {\"id\": 9, \"name\": \"binary_column\", \"type\": \"Binary\"},\r\n" + " {\"id\": 10, \"name\": \"nested_table_column\", \"type\": \"List:first_level_nested_table\", \"hasLargeList\": true},\r\n" + " {\"id\": 11, \"name\": \"struct_column\", \"type\": \"struct_table\"},\r\n" + " {\"id\": 12, \"name\": \"int_list_column\", \"type\": \"List:Integer\"},\r\n" + " {\"id\": 0, \"name\": \"string_derived_column\", \"type\": \"String\", \"default\": \"Unknown\", \"isDerived\": true},\r\n" + " {\"id\": 0, \"name\": \"int_derived_column\", \"type\": \"Integer\", \"default\": \"0\", \"isDerived\": true}\r\n" + " ]\r\n" + " }\r\n" + " ]\r\n" + "}\r\n"; Schema nextSchema = new JsonSchemaConvertor().apply(json_schema); SchemaEvolutionValidation validate = new SchemaEvolutionValidation(currentSchema); validate.check(nextSchema); }