carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [1/2] incubator-carbondata git commit: Fixed casesensitive field issue in join queries
Date Tue, 09 Aug 2016 03:57:30 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 8e224aac9 -> 2f56377cd


Fixed casesensitive field issue in join queries


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

Branch: refs/heads/master
Commit: ba3fd4ceb0a5505201cd4291c6294d852ea4419c
Parents: 8e224aa
Author: ravipesala <ravi.pesala@gmail.com>
Authored: Mon Aug 8 17:40:45 2016 +0530
Committer: chenliang613 <chenliang613@apache.org>
Committed: Tue Aug 9 11:56:32 2016 +0800

----------------------------------------------------------------------
 .../spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala     | 2 +-
 .../scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala | 3 ++-
 .../testsuite/allqueries/AllDataTypesTestCaseAggregate.scala   | 6 ++++++
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ba3fd4ce/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala
index 6be8369..2882347 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonDecoderOptimizerHelper.scala
@@ -107,7 +107,7 @@ case class AttributeReferenceWrapper(attr: Attribute) {
 
   override def equals(other: Any): Boolean = other match {
     case ar: AttributeReferenceWrapper =>
-      attr.name == ar.attr.name && attr.exprId == ar.attr.exprId
+      attr.name.equalsIgnoreCase(ar.attr.name) && attr.exprId == ar.attr.exprId
     case _ => false
   }
   override def hashCode: Int = {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ba3fd4ce/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
index 71d920c..00cae26 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
@@ -574,7 +574,8 @@ class ResolveCarbonFunctions(relations: Seq[CarbonDecoderRelation])
     val relation = relations.find(p => p.contains(uAttr))
     if (relation.isDefined) {
       relation.get.carbonRelation.carbonRelation.metaData.dictionaryMap.get(uAttr.name) match
{
-        case Some(true) if !allAttrsNotDecode.asScala.exists(p => p.name.equals(uAttr.name))
=>
+        case Some(true)
+          if !allAttrsNotDecode.asScala.exists(p => p.name.equalsIgnoreCase(uAttr.name))
=>
           val newAttr = AttributeReference(attr.name,
             IntegerType,
             attr.nullable,

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ba3fd4ce/integration/spark/src/test/scala/org/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/scala/org/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
b/integration/spark/src/test/scala/org/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
index 7b9a910..7d73234 100644
--- a/integration/spark/src/test/scala/org/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
+++ b/integration/spark/src/test/scala/org/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
@@ -1108,4 +1108,10 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll
{
       sql("select Min(imei) from (select imei from Carbon_automation_hive order by imei)
t"))
   })
 
+  test("select b.IMEI from Carbon_automation_test a join Carbon_automation_test b on a.imei=b.imei")({
+    checkAnswer(
+      sql("select b.IMEI from Carbon_automation_test a join Carbon_automation_test b on a.imei=b.imei"),
+      sql("select b.IMEI from Carbon_automation_hive a join Carbon_automation_hive b on a.imei=b.imei"))
+  })
+
 }
\ No newline at end of file


Mime
View raw message