Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1626#discussion_r155437483
--- Diff:
core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java
---
@@ -719,4 +719,34 @@ public long size() throws IOException {
}
return dataSize + indexSize;
}
+
+ /**
+ * Utility function to check whether table has timseries datamap or not
+ * @param carbonTable
+ * @return timeseries data map present
+ */
+ public static boolean hasTimeSeriesDataMap(CarbonTable carbonTable) {
+ List<DataMapSchema> dataMapSchemaList =
carbonTable.getTableInfo().getDataMapSchemaList();
+ for (DataMapSchema dataMapSchema : dataMapSchemaList) {
+ if (dataMapSchema instanceof AggregationDataMapSchema) {
+ return ((AggregationDataMapSchema)
dataMapSchema).isTimeseriesDataMap();
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Utility function to check whether table has timseries datamap or not
+ * @param carbonTable
+ * @return timeseries data map present
+ */
+ public static boolean hasAggregationDataMap(CarbonTable carbonTable) {
--- End diff --
Please move to utility
---