Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1865#discussion_r164413704
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/timeseries/TimeSeriesUtil.scala
---
@@ -54,6 +55,67 @@ object TimeSeriesUtil {
}
}
+ def getGranularityKey(dmProperties: Map[String, String]): String = {
+
+ for (granularity <- Granularity.values()) {
+ if (dmProperties.get(granularity.getName).isDefined) {
+ return granularity.getName
+ }
+ }
+
+ throw new CarbonIllegalArgumentException(
+ s"${TIMESERIES.getName} should define time granularity")
+ }
+
+ def validateTimeSeriesGranularity(
+ dmProperties: Map[String, String],
+ dmClassName: String): Boolean = {
+ var count = 0
+
+ for (granularity <- Granularity.values()) {
--- End diff --
when we found the second granularity, we can break the loop, but first can
not.
---