Github user sraghunandan commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1865#discussion_r164323109 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/timeseries/TimeSeriesUtil.scala --- @@ -54,6 +56,107 @@ object TimeSeriesUtil { } } + def getGranularityKey(dmProperties: Map[String, String]): String = { + + if (dmProperties.get(YEAR.getName).isDefined) { + return YEAR.getName + } + if (dmProperties.get(MONTH.getName).isDefined) { + return MONTH.getName + } + if (dmProperties.get(DAY.getName).isDefined) { + return DAY.getName + } + if (dmProperties.get(HOUR.getName).isDefined) { + return HOUR.getName + } + if (dmProperties.get(MINUTE.getName).isDefined) { + return MINUTE.getName + } + if (dmProperties.get(SECOND.getName).isDefined) { + return SECOND.getName + } + throw new CarbonIllegalArgumentException( + s"${TIMESERIES.getName} should define time granularity") + } + def validateTimeSeriesGranularity( + dmProperties: Map[String, String], + dmClassName: String): Boolean = { + var sum = 0 --- End diff -- change to count
---