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 2017/03/16 14:31:21 UTC

[1/2] incubator-carbondata git commit: fix compilation for codegen

Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 0513fc1d3 -> 26c888180


fix compilation for codegen


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

Branch: refs/heads/master
Commit: ea1f7192d75e6262ae4b5cc1bede475d7da2e179
Parents: 0513fc1
Author: jackylk <ja...@huawei.com>
Authored: Thu Mar 16 22:07:02 2017 +0800
Committer: jackylk <ja...@huawei.com>
Committed: Thu Mar 16 22:08:36 2017 +0800

----------------------------------------------------------------------
 .../spark/sql/CarbonDictionaryDecoder.scala     | 46 +++++++++++---------
 1 file changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ea1f7192/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
index 0d50a26..865f867 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
@@ -121,10 +121,9 @@ case class CarbonDictionaryDecoder(
     }
   }
 
-  val getDictionaryColumnIds = {
-    val attributes = child.output
-    val dictIds: Array[(String, ColumnIdentifier, CarbonDimension)] = attributes.map { a =>
-      val attr = aliasMap.getOrElse(a, a)
+  val getDictionaryColumnIds: Array[(String, ColumnIdentifier, CarbonDimension)] = {
+    child.output.map { attribute =>
+      val attr = aliasMap.getOrElse(attribute, attribute)
       val relation = relations.find(p => p.contains(attr))
       if (relation.isDefined && canBeDecoded(attr)) {
         val carbonTable = relation.get.carbonRelation.carbonRelation.metaData.carbonTable
@@ -133,7 +132,7 @@ case class CarbonDictionaryDecoder(
         if (carbonDimension != null &&
             carbonDimension.hasEncoding(Encoding.DICTIONARY) &&
             !carbonDimension.hasEncoding(Encoding.DIRECT_DICTIONARY) &&
-            !carbonDimension.isComplex()) {
+            !carbonDimension.isComplex) {
           (carbonTable.getFactTableName, carbonDimension.getColumnIdentifier,
             carbonDimension)
         } else {
@@ -142,9 +141,7 @@ case class CarbonDictionaryDecoder(
       } else {
         (null, null, null)
       }
-
     }.toArray
-    dictIds
   }
 
   override def doExecute(): RDD[InternalRow] = {
@@ -241,7 +238,7 @@ case class CarbonDictionaryDecoder(
              |}
              """.stripMargin
 
-            val caseCode = getDictionaryColumnIds(index)._3 match {
+            val caseCode = getDictionaryColumnIds(index)._3.getDataType match {
               case DataType.INT =>
                 s"""
                    |int $value = Integer.parseInt(new String($valueIntern,
@@ -346,19 +343,28 @@ case class CarbonDictionaryDecoder(
 
   private def getDictionaryWrapper(atiMap: Map[String, AbsoluteTableIdentifier],
       cache: Cache[DictionaryColumnUniqueIdentifier, Dictionary], storePath: String) = {
-    val dicts: Seq[ForwardDictionaryWrapper] = getDictionaryColumnIds.map { dictInfo =>
-      if (dictInfo._2 != null) {
-        try {
-          new ForwardDictionaryWrapper(storePath, atiMap(dictInfo._1), dictInfo._2, dictInfo._3,
-            cache.get(new DictionaryColumnUniqueIdentifier(
-            atiMap(dictInfo._1).getCarbonTableIdentifier,
-            dictInfo._2, dictInfo._3)))
-        } catch {
-          case _: Throwable => null
+    val dicts: Seq[ForwardDictionaryWrapper] = getDictionaryColumnIds.map {
+      case (tableName, columnIdentifier, carbonDimension) =>
+        if (columnIdentifier != null) {
+          try {
+            new ForwardDictionaryWrapper(
+              storePath,
+              atiMap(tableName),
+              columnIdentifier,
+              carbonDimension.getDataType,
+              cache.get(
+                new DictionaryColumnUniqueIdentifier(
+                  atiMap(tableName).getCarbonTableIdentifier,
+                  columnIdentifier
+                )
+              )
+            )
+          } catch {
+            case _: Throwable => null
+          }
+        } else {
+          null
         }
-      } else {
-        null
-      }
     }
     dicts
   }


[2/2] incubator-carbondata git commit: Fix compilation for codegen This closes #663

Posted by ra...@apache.org.
Fix compilation for codegen This closes #663


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

Branch: refs/heads/master
Commit: 26c888180ae8b1b49f796f932eee68f4d72dd7c7
Parents: 0513fc1 ea1f719
Author: ravipesala <ra...@gmail.com>
Authored: Thu Mar 16 20:00:58 2017 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Thu Mar 16 20:00:58 2017 +0530

----------------------------------------------------------------------
 .../spark/sql/CarbonDictionaryDecoder.scala     | 46 +++++++++++---------
 1 file changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------