carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3437: [CARBONDATA-3530] Support Create timeseries MV Datamap with the supported granularity levels.
Date Thu, 14 Nov 2019 06:21:13 GMT
ajantha-bhat commented on a change in pull request #3437: [CARBONDATA-3530] Support Create
timeseries MV Datamap with the supported granularity levels.
URL: https://github.com/apache/carbondata/pull/3437#discussion_r346142374
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVHelper.scala
 ##########
 @@ -840,5 +895,57 @@ object MVHelper {
       case _ => outputList
     }.get
   }
+
+  private def validateMVTimeSeriesQuery(sparkSession: SparkSession,
+      logicalPlan: LogicalPlan, dataMapSchema: DataMapSchema): (String, String) = {
+    var timeSeriesColumn: String = null
+    var timeSeriesFunction: String = null
+    logicalPlan.transformExpressions {
+      case a@Alias(udf: ScalaUDF, _) =>
+        if (udf.function.isInstanceOf[TimeSeriesFunction]) {
+          if (null == timeSeriesColumn && null == timeSeriesFunction) {
+            udf.children.collect {
+              case attr: AttributeReference =>
+                timeSeriesColumn = attr.name
+              case l: Literal =>
+                timeSeriesFunction = l.value.toString
+              case c: Cast =>
+                c.child match {
+                  case attribute: AttributeReference =>
+                    if (attribute.dataType.isInstanceOf[DateType]) {
 
 Review comment:
   Need to check for timestamp also ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message