@Test public void testValidateTransformFunctionArguments() { Schema pinotSchema; pinotSchema = new Schema(); DimensionFieldSpec dimensionFieldSpec = new DimensionFieldSpec("dim1", DataType.STRING, true); dimensionFieldSpec.setTransformFunction("Groovy({function}, argument1, dim1, argument3)"); pinotSchema.addField(dimensionFieldSpec); try { SchemaUtils.validate(pinotSchema); Assert.fail("Schema validation should have failed."); } catch (IllegalStateException e) { } pinotSchema = new Schema(); MetricFieldSpec metricFieldSpec = new MetricFieldSpec("m1", DataType.LONG); metricFieldSpec.setTransformFunction("Groovy({function}, m1, m1)"); pinotSchema.addField(metricFieldSpec); checkValidationFails(pinotSchema); pinotSchema = new Schema(); DateTimeFieldSpec dateTimeFieldSpec = new DateTimeFieldSpec("dt1", DataType.LONG, "1:HOURS:EPOCH", "1:HOURS"); dateTimeFieldSpec.setTransformFunction("Groovy({function}, m1, dt1)"); pinotSchema.addField(dateTimeFieldSpec); checkValidationFails(pinotSchema); pinotSchema = new Schema.SchemaBuilder().addTime(new TimeGranularitySpec(DataType.LONG, TimeUnit.MILLISECONDS, "time"), null) .build(); pinotSchema.getFieldSpecFor("time").setTransformFunction("Groovy({function}, time)"); checkValidationFails(pinotSchema); pinotSchema = new Schema.SchemaBuilder().addSingleValueDimension("x", DataType.INT).addSingleValueDimension("z", DataType.INT) .build(); pinotSchema.getFieldSpecFor("x").setTransformFunction("Groovy({y + 10}, y)"); pinotSchema.getFieldSpecFor("z").setTransformFunction("Groovy({x*w*20}, x, w)"); checkValidationFails(pinotSchema); }
public static void validate(Schema schema, List<TableConfig> tableConfigs) { for (TableConfig tableConfig : tableConfigs) { validateCompatibilityWithTableConfig(schema, tableConfig); } validate(schema); }
SchemaUtils { public static void validate(Schema schema, List<TableConfig> tableConfigs) { for (TableConfig tableConfig : tableConfigs) { validateCompatibilityWithTableConfig(schema, tableConfig); } validate(schema); } }
SchemaUtils { public static void validate(Schema schema, List<TableConfig> tableConfigs) { for (TableConfig tableConfig : tableConfigs) { validateCompatibilityWithTableConfig(schema, tableConfig); } validate(schema); }  }
SchemaUtils { public static void validate(Schema schema, List<TableConfig> tableConfigs) { for (TableConfig tableConfig : tableConfigs) { validateCompatibilityWithTableConfig(schema, tableConfig); } validate(schema); }  static void validate(Schema schema, List<TableConfig> tableConfigs); static void validate(Schema schema); }
SchemaUtils { public static void validate(Schema schema, List<TableConfig> tableConfigs) { for (TableConfig tableConfig : tableConfigs) { validateCompatibilityWithTableConfig(schema, tableConfig); } validate(schema); }  static void validate(Schema schema, List<TableConfig> tableConfigs); static void validate(Schema schema); static final String MAP_KEY_COLUMN_SUFFIX; static final String MAP_VALUE_COLUMN_SUFFIX; }