Class SchemaUtils


  • public class SchemaUtils
    extends Object
    Schema utils FIXME: Merge this SchemaUtils with the SchemaUtils from pinot-common when merging of modules happens
    • Method Detail

      • validate

        public static void validate​(Schema schema,
                                    List<TableConfig> tableConfigs)
        Validates the schema. First checks that the schema is compatible with any provided table configs associated with it. This check is useful to ensure schema and table are compatible, in the event that schema is updated or added after the table config Then validates the schema using validate(Schema schema)
        Parameters:
        schema - schema to validate
        tableConfigs - table configs associated with this schema (table configs with raw name = schema name)
      • validate

        public static void validate​(Schema schema)
        Validates the following: 1) Column name should not contain blank space. 2) Checks valid transform function - for a field spec with transform function, the source column name and destination column name are exclusive i.e . do not allow using source column name for destination column ensure transform function string can be used to create a FunctionEvaluator 3) Checks for chained transforms/derived transform - not supported yet TODO: Transform functions have moved to table config. Once we stop supporting them in schema, remove the validations 2 and 3 4) Checks valid timeFieldSpec - if incoming and outgoing granularity spec are different a) the names cannot be same b) cannot use SIMPLE_DATE_FORMAT for conversion 5) Checks valid dateTimeFieldSpecs - checks format and granularity string 6) Schema validations from Schema.validate()