carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject incubator-carbondata git commit: During join operation, same column is available in two table. User do select on first table column and add filter on other table column. Because of this, top level decoder finds that column is already decoded in bottom la
Date Mon, 07 Nov 2016 15:13:00 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/branch-0.2 b1d87672d -> 9b99b17a4


During join operation, same column is available in two table. User do select on first table
column and add filter on other table column.
Because of this, top level decoder finds that column is already decoded in bottom layer(because
its comparing by name) and hence its not decoding.


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

Branch: refs/heads/branch-0.2
Commit: 9b99b17a4c59285d1b5086493c65ce91d0beb3e7
Parents: b1d8767
Author: ashok.blend <ashok.blend@gmail.com>
Authored: Mon Nov 7 00:07:28 2016 -0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Mon Nov 7 20:42:37 2016 +0530

----------------------------------------------------------------------
 .../apache/spark/sql/CarbonDictionaryDecoder.scala    |  4 ++--
 integration/spark/src/test/resources/join/emp.csv     |  1 +
 integration/spark/src/test/resources/join/mgr.csv     |  1 +
 .../joinquery/AllDataTypesTestCaseJoin.scala          | 14 ++++++++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/9b99b17a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
index 12cdf9d..a19ce58 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonDictionaryDecoder.scala
@@ -82,10 +82,10 @@ case class CarbonDictionaryDecoder(
     profile match {
       case ip: IncludeProfile if ip.attributes.nonEmpty =>
         ip.attributes
-          .exists(a => a.name.equalsIgnoreCase(attr.name))
+          .exists(a => a.name.equalsIgnoreCase(attr.name) && a.exprId == attr.exprId)
       case ep: ExcludeProfile =>
         !ep.attributes
-          .exists(a => a.name.equalsIgnoreCase(attr.name))
+          .exists(a => a.name.equalsIgnoreCase(attr.name) && a.exprId == attr.exprId)
       case _ => true
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/9b99b17a/integration/spark/src/test/resources/join/emp.csv
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/resources/join/emp.csv b/integration/spark/src/test/resources/join/emp.csv
new file mode 100644
index 0000000..23a235a
--- /dev/null
+++ b/integration/spark/src/test/resources/join/emp.csv
@@ -0,0 +1 @@
+tom,t23717,h2399,99780207526

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/9b99b17a/integration/spark/src/test/resources/join/mgr.csv
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/resources/join/mgr.csv b/integration/spark/src/test/resources/join/mgr.csv
new file mode 100644
index 0000000..5ab1d83
--- /dev/null
+++ b/integration/spark/src/test/resources/join/mgr.csv
@@ -0,0 +1 @@
+harry,h2399,v788232,99823230205

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/9b99b17a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/joinquery/AllDataTypesTestCaseJoin.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/joinquery/AllDataTypesTestCaseJoin.scala
b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/joinquery/AllDataTypesTestCaseJoin.scala
index bbcaad2..83fdd59 100644
--- a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/joinquery/AllDataTypesTestCaseJoin.scala
+++ b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/joinquery/AllDataTypesTestCaseJoin.scala
@@ -47,6 +47,20 @@ class AllDataTypesTestCaseJoin extends QueryTest with BeforeAndAfterAll
{
       sql("select empno,empname,utilization,count(salary),sum(empno) from alldatatypestableJoin_hive
where empname in ('arvind','ayushi') group by empno,empname,utilization"))
   }
 
+  test("select e.empid from employee e inner join manager m on e.mgrid=m.empid") {
+    sql("drop table if exists employee")
+    sql("create table employee(name string, empid string, mgrid string, mobileno bigint)
stored by 'carbondata'")
+    sql("load data inpath './src/test/resources/join/emp.csv' into table employee options('fileheader'='name,empid,mgrid,mobileno')")
+    
+    sql("drop table if exists manager")
+    sql("create table manager(name string, empid string, mgrid string, mobileno bigint) stored
by 'carbondata'")
+    sql("load data inpath './src/test/resources/join/mgr.csv' into table manager options('fileheader'='name,empid,mgrid,mobileno')")
+    checkAnswer(
+    sql("select e.empid from employee e inner join manager m on e.mgrid=m.empid"),
+    Seq(Row("t23717"))
+    )
+   
+  }
   override def afterAll {
     sql("drop table alldatatypestableJoin")
     sql("drop table alldatatypestableJoin_hive")


Mime
View raw message