You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ch...@apache.org on 2016/11/07 13:38:19 UTC
[1/2] incubator-carbondata git commit: Fixed null and not null in sub
queries
Repository: incubator-carbondata
Updated Branches:
refs/heads/master f6cceaa08 -> e65978281
Fixed null and not null in sub 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/a14643d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/a14643d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/a14643d8
Branch: refs/heads/master
Commit: a14643d8921ec25e7d4b282d8b8d5fb4b4032ad9
Parents: f6cceaa
Author: ravipesala <ra...@gmail.com>
Authored: Mon Nov 7 09:41:10 2016 +0530
Committer: chenliang613 <ch...@apache.org>
Committed: Mon Nov 7 21:36:42 2016 +0800
----------------------------------------------------------------------
.../org/apache/carbondata/spark/CarbonFilters.scala | 4 ++--
.../testsuite/bigdecimal/TestNullAndEmptyFields.scala | 14 ++++++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/a14643d8/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonFilters.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonFilters.scala b/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonFilters.scala
index 03c6053..711c51c 100644
--- a/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonFilters.scala
+++ b/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonFilters.scala
@@ -258,10 +258,10 @@ object CarbonFilters {
Some(new NotEqualsExpression(transformExpression(a).get, transformExpression(l).get))
case Not(EqualTo(l@Literal(v, t), Cast(a: Attribute, _))) => new
Some(new NotEqualsExpression(transformExpression(a).get, transformExpression(l).get))
- case IsNotNull(child) =>
+ case IsNotNull(child: Attribute) =>
Some(new NotEqualsExpression(transformExpression(child).get,
transformExpression(Literal(null)).get, true))
- case IsNull(child) =>
+ case IsNull(child: Attribute) =>
Some(new EqualToExpression(transformExpression(child).get,
transformExpression(Literal(null)).get, true))
case Not(In(a: Attribute, list))
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/a14643d8/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/bigdecimal/TestNullAndEmptyFields.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/bigdecimal/TestNullAndEmptyFields.scala b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/bigdecimal/TestNullAndEmptyFields.scala
index 1e82edf..85d6f85 100644
--- a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/bigdecimal/TestNullAndEmptyFields.scala
+++ b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/bigdecimal/TestNullAndEmptyFields.scala
@@ -99,6 +99,20 @@ class TestNullAndEmptyFields extends QueryTest with BeforeAndAfterAll {
)
}
+ test("test subquery on column having null values") {
+ checkAnswer(
+ sql("select * from (select if(country='china','c', country) test from carbonTable)qq where test is null"),
+ sql("select * from (select if(country='china','c', country) test from hiveTable)qq where test is null")
+ )
+ }
+
+ test("test subquery on column having not null values") {
+ checkAnswer(
+ sql("select * from (select if(country='china','c', country) test from carbonTable)qq where test is not null"),
+ sql("select * from (select if(country='china','c', country) test from hiveTable)qq where test is not null")
+ )
+ }
+
override def afterAll {
sql("drop table if exists carbonTable")
sql("drop table if exists hiveTable")
[2/2] incubator-carbondata git commit: [CARBONDATA-359]is null & not
null functions are not working when data fetching from sub query This closes
#300
Posted by ch...@apache.org.
[CARBONDATA-359]is null & not null functions are not working when data fetching from sub query This closes #300
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/e6597828
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/e6597828
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/e6597828
Branch: refs/heads/master
Commit: e65978281a121a3afc7368864520ecf74b64cd87
Parents: f6cceaa a14643d
Author: chenliang613 <ch...@apache.org>
Authored: Mon Nov 7 21:37:55 2016 +0800
Committer: chenliang613 <ch...@apache.org>
Committed: Mon Nov 7 21:37:55 2016 +0800
----------------------------------------------------------------------
.../org/apache/carbondata/spark/CarbonFilters.scala | 4 ++--
.../testsuite/bigdecimal/TestNullAndEmptyFields.scala | 14 ++++++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------