Class SchemaUtils
- java.lang.Object
-
- org.apache.pinot.segment.local.utils.SchemaUtils
-
public class SchemaUtils extends Object
Schema utils FIXME: Merge this SchemaUtils with the SchemaUtils from pinot-common when merging of modules happens
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAP_KEY_COLUMN_SUFFIXstatic StringMAP_VALUE_COLUMN_SUFFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidvalidate(Schema schema)Validates the following: 1) Column name should not contain blank space.static voidvalidate(Schema schema, boolean isIgnoreCase)static voidvalidate(Schema schema, List<TableConfig> tableConfigs)Validates the schema.static voidvalidate(Schema schema, List<TableConfig> tableConfigs, boolean isIgnoreCase)
-
-
-
Field Detail
-
MAP_KEY_COLUMN_SUFFIX
public static final String MAP_KEY_COLUMN_SUFFIX
- See Also:
- Constant Field Values
-
MAP_VALUE_COLUMN_SUFFIX
public static final String MAP_VALUE_COLUMN_SUFFIX
- See Also:
- Constant Field Values
-
-
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 usingvalidate(Schema schema)- Parameters:
schema- schema to validatetableConfigs- table configs associated with this schema (table configs with raw name = schema name)
-
validate
public static void validate(Schema schema, List<TableConfig> tableConfigs, @Nullable boolean isIgnoreCase)
-
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 aFunctionEvaluator3) 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 fromSchema.validate(org.apache.pinot.spi.data.FieldSpec.FieldType, org.apache.pinot.spi.data.FieldSpec.DataType)
-
validate
public static void validate(Schema schema, boolean isIgnoreCase)
-
-