Indhumathi27 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_r346175034
##########
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:
Timeseries function's child node will conatin Attribute reference of Timestamp type or Cast of Attribute reference as Timestamp type. Hence no need to for check for timestamp separately
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services