You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2018/11/30 16:34:01 UTC

[08/26] carbondata git commit: [CARBONDATA-3131] Update the requested columns to the Scan

[CARBONDATA-3131] Update the requested columns to the Scan

Get the updated list of requested columns for Scan task

This closes #2952


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/1dd7f9e5
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/1dd7f9e5
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/1dd7f9e5

Branch: refs/heads/branch-1.5
Commit: 1dd7f9e524ac0877154065d6f5c651cd91d189d7
Parents: 51156e9
Author: dhatchayani <dh...@gmail.com>
Authored: Tue Nov 27 10:13:33 2018 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Fri Nov 30 21:55:29 2018 +0530

----------------------------------------------------------------------
 .../execution/strategy/CarbonLateDecodeStrategy.scala   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/1dd7f9e5/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala
index 6993ecc..a2c4bd0 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala
@@ -390,8 +390,7 @@ private[sql] class CarbonLateDecodeStrategy extends SparkStrategy {
       }
       // Don't request columns that are only referenced by pushed filters.
       val requestedColumns =
-        (projectsAttr.to[mutable.LinkedHashSet] ++ filterSet -- handledSet)
-          .map(relation.attributeMap).toSeq ++ newProjectList
+        getRequestedColumns(relation, projectsAttr, filterSet, handledSet, newProjectList)
 
       var updateRequestedColumns =
         if (!vectorPushRowFilters && !implictsExisted && !hasDictionaryFilterCols
@@ -446,6 +445,15 @@ private[sql] class CarbonLateDecodeStrategy extends SparkStrategy {
     }
   }
 
+  protected def getRequestedColumns(relation: LogicalRelation,
+      projectsAttr: Seq[Attribute],
+      filterSet: AttributeSet,
+      handledSet: AttributeSet,
+      newProjectList: Seq[Attribute]) = {
+    (projectsAttr.to[mutable.LinkedHashSet] ++ filterSet -- handledSet)
+      .map(relation.attributeMap).toSeq ++ newProjectList
+  }
+
   private def getDataSourceScan(relation: LogicalRelation,
       output: Seq[Attribute],
       partitions: Seq[PartitionSpec],