Package org.apache.pinot.spi.utils
Class TimestampIndexUtils
- java.lang.Object
-
- org.apache.pinot.spi.utils.TimestampIndexUtils
-
public class TimestampIndexUtils extends Object
-
-
Method Summary
Modifier and Type Method Description static voidapplyTimestampIndex(TableConfig tableConfig, Schema schema)Applies the TIMESTAMP index configured in the table config: - Adds the derived timestamp columns with granularity to the schema - Adds transform for the derived timestamp columns with granularity - Adds range index to the derived timestamp columns with granularitystatic Set<String>extractColumnsWithGranularity(TableConfig tableConfig)Extracts all columns with granularity based on the TIMESTAMP index config.static StringgetColumnWithGranularity(String timestampColumn, String granularity)Returns the column name with granularity, e.g.static StringgetColumnWithGranularity(String timestampColumn, TimestampIndexGranularity granularity)Returns the column name with granularity, e.g.static booleanisValidColumnWithGranularity(String column)Returns whether the given column nane is a column name with granularity.static booleanisValidGranularity(String granularity)Returns whether the given string is a valid granularity.
-
-
-
Method Detail
-
getColumnWithGranularity
public static String getColumnWithGranularity(String timestampColumn, TimestampIndexGranularity granularity)
Returns the column name with granularity, e.g. $ts$DAY.
-
getColumnWithGranularity
public static String getColumnWithGranularity(String timestampColumn, String granularity)
Returns the column name with granularity, e.g. $ts$DAY.
-
isValidGranularity
public static boolean isValidGranularity(String granularity)
Returns whether the given string is a valid granularity.
-
isValidColumnWithGranularity
public static boolean isValidColumnWithGranularity(String column)
Returns whether the given column nane is a column name with granularity.
-
extractColumnsWithGranularity
public static Set<String> extractColumnsWithGranularity(TableConfig tableConfig)
Extracts all columns with granularity based on the TIMESTAMP index config.
-
applyTimestampIndex
public static void applyTimestampIndex(TableConfig tableConfig, Schema schema)
Applies the TIMESTAMP index configured in the table config: - Adds the derived timestamp columns with granularity to the schema - Adds transform for the derived timestamp columns with granularity - Adds range index to the derived timestamp columns with granularity
-
-