ravipesala commented on a change in pull request #3150: [CARBONDATA-3309] MV datamap supports Spark 2.1
URL:
https://github.com/apache/carbondata/pull/3150#discussion_r284124227
##########
File path: datamap/mv/plan/src/main/scala/org/apache/carbondata/mv/plans/modular/ModularRelation.scala
##########
@@ -47,14 +47,7 @@ case class ModularRelation(databaseName: String,
override def computeStats(spark: SparkSession, conf: SQLConf): Statistics = {
val plan = spark.table(s"${ databaseName }.${ tableName }").queryExecution.optimizedPlan
val stats = SparkSQLUtil.invokeStatsMethod(plan, conf)
- val output = outputList.map(_.toAttribute)
- val mapSeq = plan.collect { case n: logical.LeafNode => n }.map {
- table => AttributeMap(table.output.zip(output))
- }
- val rewrites = mapSeq(0)
- val attributeStats = AttributeMap(stats.attributeStats.iterator
- .map { pair => (rewrites(pair._1), pair._2) }.toSeq)
- Statistics(stats.sizeInBytes, stats.rowCount, attributeStats, stats.hints)
+ SparkSQLUtil.getStatisticsObj(outputList, plan, stats)
Review comment:
ok
----------------------------------------------------------------
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