tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [16/50] [abbrv] git commit: TAJO-840: Improve query result print with counting empty table. (jaehwa)
Date Wed, 09 Jul 2014 04:10:33 GMT
TAJO-840: Improve query result print with counting empty table. (jaehwa)


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

Branch: refs/heads/window_function
Commit: f3092c4205054e7be75f5729588c4accb1cf97c6
Parents: 1474a2a
Author: blrunner <jhjung@gruter.com>
Authored: Wed Jun 11 12:35:48 2014 -0700
Committer: blrunner <jhjung@gruter.com>
Committed: Wed Jun 11 12:35:48 2014 -0700

----------------------------------------------------------------------
 CHANGES                                         |   2 +
 .../DistinctGroupbyHashAggregationExec.java     |  14 ++-
 .../DistinctGroupbySortAggregationExec.java     |  42 ++++++-
 .../planner/physical/HashAggregateExec.java     |  12 +-
 .../planner/physical/SortAggregateExec.java     |   8 +-
 .../tajo/master/querymaster/Repartitioner.java  |  12 +-
 .../main/java/org/apache/tajo/worker/Task.java  |  16 ++-
 .../tajo/engine/query/TestGroupByQuery.java     | 111 ++++++++++++++++++-
 .../testGroupByWithNullData1.sql                |   1 +
 .../testGroupByWithNullData10.sql               |   3 +
 .../testGroupByWithNullData11.sql               |   5 +
 .../testGroupByWithNullData12.sql               |  29 +++++
 .../testGroupByWithNullData2.sql                |   1 +
 .../testGroupByWithNullData3.sql                |   3 +
 .../testGroupByWithNullData4.sql                |   3 +
 .../testGroupByWithNullData5.sql                |   1 +
 .../testGroupByWithNullData6.sql                |   1 +
 .../testGroupByWithNullData7.sql                |   1 +
 .../testGroupByWithNullData8.sql                |   1 +
 .../testGroupByWithNullData9.sql                |   4 +
 .../testGroupByWithNullData1.result             |   3 +
 .../testGroupByWithNullData10.result            |   3 +
 .../testGroupByWithNullData11.result            |   2 +
 .../testGroupByWithNullData12.result            |   2 +
 .../testGroupByWithNullData2.result             |   3 +
 .../testGroupByWithNullData3.result             |   3 +
 .../testGroupByWithNullData4.result             |   3 +
 .../testGroupByWithNullData5.result             |   3 +
 .../testGroupByWithNullData6.result             |   3 +
 .../testGroupByWithNullData7.result             |   3 +
 .../testGroupByWithNullData8.result             |   3 +
 .../testGroupByWithNullData9.result             |   2 +
 32 files changed, 283 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 3276338..96003e4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,8 @@ Release 0.9.0 - unreleased
 
   IMPROVEMENT
 
+    TAJO-840: Improve query result print with counting empty table. (jaehwa)
+
     TAJO-844: JDBC should be support getTime, getDate, and getTimestamp. 
     (Hyoungjun Kim via hyunsik)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbyHashAggregationExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbyHashAggregationExec.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbyHashAggregationExec.java
index 8daad0b..1a4b706 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbyHashAggregationExec.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbyHashAggregationExec.java
@@ -21,6 +21,7 @@ package org.apache.tajo.engine.planner.physical;
 import org.apache.tajo.catalog.Column;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.catalog.statistics.TableStats;
+import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.datum.NullDatum;
 import org.apache.tajo.engine.eval.AggregationFunctionCallEval;
 import org.apache.tajo.engine.function.FunctionContext;
@@ -156,7 +157,18 @@ public class DistinctGroupbyHashAggregationExec extends PhysicalExec
{
     if (nullCount == hashAggregators.length) {
       finished = true;
       progress = 1.0f;
-      return null;
+
+      // If DistinctGroupbyHashAggregationExec didn't has any rows,
+      // it should return NullDatum.
+      if (totalNumRows == 0 && groupbyNodeNum == 0) {
+        Tuple tuple = new VTuple(hashAggregators.length);
+        for (int i = 0; i < tuple.size(); i++) {
+          tuple.put(i, DatumFactory.createNullDatum());
+        }
+        return tuple;
+      } else {
+        return null;
+      }
     }
 
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbySortAggregationExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbySortAggregationExec.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbySortAggregationExec.java
index fd79725..b786672 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbySortAggregationExec.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/DistinctGroupbySortAggregationExec.java
@@ -19,6 +19,9 @@
 package org.apache.tajo.engine.planner.physical;
 
 import org.apache.tajo.catalog.statistics.TableStats;
+import org.apache.tajo.common.TajoDataTypes;
+import org.apache.tajo.datum.DatumFactory;
+import org.apache.tajo.datum.NullDatum;
 import org.apache.tajo.engine.planner.logical.DistinctGroupbyNode;
 import org.apache.tajo.engine.planner.logical.GroupbyNode;
 import org.apache.tajo.storage.Tuple;
@@ -79,11 +82,14 @@ public class DistinctGroupbySortAggregationExec extends PhysicalExec {
     }
 
     boolean allNull = true;
+
     for (int i = 0; i < groupbyNodeNum; i++) {
       if (first && i > 0) {
         // All SortAggregateExec uses same SeqScanExec object.
         // After running sort, rescan() should be called.
-        aggregateExecs[i].rescan();
+        if (currentTuples[i-1] != null) {
+          aggregateExecs[i].rescan();
+        }
       }
       currentTuples[i] = aggregateExecs[i].next();
 
@@ -91,6 +97,13 @@ public class DistinctGroupbySortAggregationExec extends PhysicalExec {
         allNull = false;
       }
     }
+
+    // If DistinctGroupbySortAggregationExec received NullDatum and didn't has any grouping
keys,
+    // it should return primitive values for NullDatum.
+    if (allNull && aggregateExecs[0].groupingKeyNum == 0 && first)   {
+      return getEmptyTuple();
+    }
+
     first = false;
 
     if (allNull) {
@@ -113,6 +126,33 @@ public class DistinctGroupbySortAggregationExec extends PhysicalExec
{
     return mergedTuple;
   }
 
+  private Tuple getEmptyTuple() {
+    Tuple tuple = new VTuple(outColumnNum);
+    NullDatum nullDatum = DatumFactory.createNullDatum();
+
+    for (int i = 0; i < outColumnNum; i++) {
+      TajoDataTypes.Type type = outSchema.getColumn(i).getDataType().getType();
+      if (type == TajoDataTypes.Type.INT8) {
+        tuple.put(i, DatumFactory.createInt8(nullDatum.asInt8()));
+      } else if (type == TajoDataTypes.Type.INT4) {
+        tuple.put(i, DatumFactory.createInt4(nullDatum.asInt4()));
+      } else if (type == TajoDataTypes.Type.INT2) {
+        tuple.put(i, DatumFactory.createInt2(nullDatum.asInt2()));
+      } else if (type == TajoDataTypes.Type.FLOAT4) {
+        tuple.put(i, DatumFactory.createFloat4(nullDatum.asFloat4()));
+      } else if (type == TajoDataTypes.Type.FLOAT8) {
+        tuple.put(i, DatumFactory.createFloat8(nullDatum.asFloat8()));
+      } else {
+        tuple.put(i, DatumFactory.createNullDatum());
+      }
+    }
+
+    finished = true;
+    first = false;
+
+    return tuple;
+  }
+
   @Override
   public void close() throws IOException {
     plan = null;

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/HashAggregateExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/HashAggregateExec.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/HashAggregateExec.java
index c87e01a..3323d1f 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/HashAggregateExec.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/HashAggregateExec.java
@@ -69,6 +69,16 @@ public class HashAggregateExec extends AggregationExec {
         hashTable.put(keyTuple, contexts);
       }
     }
+
+    // If HashAggregateExec received NullDatum and didn't has any grouping keys,
+    // it should return primitive values for NullLDatum.
+    if (groupingKeyNum == 0 && aggFunctionsNum > 0 && hashTable.entrySet().size()
== 0) {
+      FunctionContext[] contexts = new FunctionContext[aggFunctionsNum];
+      for(int i = 0; i < aggFunctionsNum; i++) {
+        contexts[i] = aggFunctions[i].newContext();
+      }
+      hashTable.put(null, contexts);
+    }
   }
 
   @Override
@@ -101,7 +111,7 @@ public class HashAggregateExec extends AggregationExec {
   }
 
   @Override
-  public void rescan() throws IOException {    
+  public void rescan() throws IOException {
     iterator = hashTable.entrySet().iterator();
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SortAggregateExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SortAggregateExec.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SortAggregateExec.java
index 9a415d1..c4d43a3 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SortAggregateExec.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/SortAggregateExec.java
@@ -18,6 +18,7 @@
 
 package org.apache.tajo.engine.planner.physical;
 
+import org.apache.tajo.datum.NullDatum;
 import org.apache.tajo.engine.function.FunctionContext;
 import org.apache.tajo.engine.planner.logical.GroupbyNode;
 import org.apache.tajo.storage.Tuple;
@@ -68,7 +69,12 @@ public class SortAggregateExec extends AggregationExec {
         if (lastKey == null) {
           for(int i = 0; i < aggFunctionsNum; i++) {
             contexts[i] = aggFunctions[i].newContext();
-            aggFunctions[i].merge(contexts[i], inSchema, tuple);
+
+            // Merge when aggregator doesn't receive NullDatum
+            if (!(groupingKeyNum == 0 && aggFunctionsNum == tuple.size()
+                && tuple.get(i) == NullDatum.get())) {
+              aggFunctions[i].merge(contexts[i], inSchema, tuple);
+            }
           }
           lastKey = currentKey;
         } else {

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
index 3a2e79f..292ae13 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
@@ -454,12 +454,6 @@ public class Repartitioner {
                                                  SubQuery subQuery, DataChannel channel,
                                                  int maxNum) {
     ExecutionBlock execBlock = subQuery.getBlock();
-    TableStats totalStat = computeChildBlocksStats(subQuery.getContext(), masterPlan, subQuery.getId());
-
-    if (totalStat.getNumRows() == 0) {
-      return;
-    }
-
     ScanNode scan = execBlock.getScanNodes()[0];
     Path tablePath;
     tablePath = subQuery.getContext().getStorageManager().getTablePath(scan.getTableName());
@@ -500,9 +494,15 @@ public class Repartitioner {
     // get a proper number of tasks
     int determinedTaskNum = Math.min(maxNum, finalFetches.size());
     LOG.info(subQuery.getId() + ", ScheduleHashShuffledFetches - Max num=" + maxNum + ",
finalFetchURI=" + finalFetches.size());
+
     if (groupby != null && groupby.getGroupingColumns().length == 0) {
       determinedTaskNum = 1;
       LOG.info(subQuery.getId() + ", No Grouping Column - determinedTaskNum is set to 1");
+    } else {
+      TableStats totalStat = computeChildBlocksStats(subQuery.getContext(), masterPlan, subQuery.getId());
+      if (totalStat.getNumRows() == 0) {
+        determinedTaskNum = 1;
+      }
     }
 
     // set the proper number of tasks to the estimated task num

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/main/java/org/apache/tajo/worker/Task.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/worker/Task.java b/tajo-core/src/main/java/org/apache/tajo/worker/Task.java
index f065951..84f41a2 100644
--- a/tajo-core/src/main/java/org/apache/tajo/worker/Task.java
+++ b/tajo-core/src/main/java/org/apache/tajo/worker/Task.java
@@ -374,17 +374,15 @@ public class Task {
         context.setProgress(FETCHER_PROGRESS);
       }
 
-      if (context.getFragmentSize() > 0) {
-        this.executor = taskRunnerContext.getTQueryEngine().
-            createPlan(context, plan);
-        this.executor.init();
+      this.executor = taskRunnerContext.getTQueryEngine().
+          createPlan(context, plan);
+      this.executor.init();
 
-        while(!killed && executor.next() != null) {
-        }
-        this.executor.close();
-        reloadInputStats();
-        this.executor = null;
+      while(!killed && executor.next() != null) {
       }
+      this.executor.close();
+      reloadInputStats();
+      this.executor = null;
     } catch (Exception e) {
       error = e ;
       LOG.error(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
index 1263bbe..d06b65f 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
@@ -29,7 +29,7 @@ import java.sql.ResultSet;
 @Category(IntegrationTest.class)
 public class TestGroupByQuery extends QueryTestCaseBase {
 
-  public TestGroupByQuery() {
+  public TestGroupByQuery() throws Exception {
     super(TajoConstants.DEFAULT_DATABASE_NAME);
   }
 
@@ -304,4 +304,113 @@ public class TestGroupByQuery extends QueryTestCaseBase {
     assertResultSet(res);
     cleanupQuery(res);
   }
+
+  @Test
+  public final void testGroupByWithNullData1() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData2() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData3() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData4() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData5() throws Exception {
+    executeString("CREATE TABLE table1 (age INT4, point FLOAT4);").close();
+    assertTableExists("table1");
+
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+
+    executeString("DROP TABLE table1");
+  }
+
+  @Test
+  public final void testGroupByWithNullData6() throws Exception {
+    executeString("CREATE TABLE table1 (age INT4, point FLOAT4);").close();
+    assertTableExists("table1");
+
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+
+    executeString("DROP TABLE table1");
+  }
+
+  @Test
+  public final void testGroupByWithNullData7() throws Exception {
+    executeString("CREATE TABLE table1 (age INT4, point FLOAT4);").close();
+    assertTableExists("table1");
+
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+
+    executeString("DROP TABLE table1");
+  }
+
+  @Test
+  public final void testGroupByWithNullData8() throws Exception {
+    executeString("CREATE TABLE table1 (age INT4, point FLOAT4);").close();
+    assertTableExists("table1");
+
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+
+    executeString("DROP TABLE table1");
+  }
+
+  @Test
+  public final void testGroupByWithNullData9() throws Exception {
+    executeString("CREATE TABLE table1 (age INT4, point FLOAT4);").close();
+    assertTableExists("table1");
+
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+
+    executeString("DROP TABLE table1");
+  }
+
+  @Test
+  public final void testGroupByWithNullData10() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData11() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithNullData12() throws Exception {
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData1.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData1.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData1.sql
new file mode 100644
index 0000000..af089df
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData1.sql
@@ -0,0 +1 @@
+select count(1) as unique_key from lineitem where l_orderkey = 1000;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData10.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData10.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData10.sql
new file mode 100644
index 0000000..98546db
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData10.sql
@@ -0,0 +1,3 @@
+select count(distinct l_linenumber) as unique_key, count(distinct l_returnflag || l_linestatus)
flag
+from lineitem
+where l_orderkey = 1000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData11.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData11.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData11.sql
new file mode 100644
index 0000000..3fae412
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData11.sql
@@ -0,0 +1,5 @@
+select l_orderkey, count(distinct l_linenumber) as unique_key
+, count(distinct l_returnflag || l_linestatus) flag
+from lineitem
+where l_orderkey = 1000
+group by l_orderkey;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData12.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData12.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData12.sql
new file mode 100644
index 0000000..3a94d82
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData12.sql
@@ -0,0 +1,29 @@
+select
+	s.s_acctbal,
+	s.s_name,
+	n.t_name,
+	p.p_partkey,
+	p.p_mfgr,
+	s.s_address,
+	s.s_phone,
+	s.s_comment
+from (
+   select n_name as t_name, n_nationkey as t_nationkey
+    , n_regionkey as t_regionkey
+    , count(distinct n_comment) as cnt
+    , count(distinct n_nationkey / n_regionkey) as diff
+   from nation
+   where n_nationkey > 10000
+   group by n_name, n_nationkey, n_regionkey, n_regionkey
+) n
+join region r on (n.t_regionkey = r.r_regionkey)
+join supplier s on (s.s_nationkey = n.t_nationkey)
+join partsupp ps on (s.s_suppkey = ps.ps_suppkey)
+join part p on (p.p_partkey = ps.ps_partkey)
+where n.t_regionkey = ps.ps_suppkey
+and n.cnt > 0
+order by
+  s.s_acctbal,
+  s.s_name,
+  n.t_name,
+  p.p_partkey;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData2.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData2.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData2.sql
new file mode 100644
index 0000000..84351af
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData2.sql
@@ -0,0 +1 @@
+select count(1) as unique_key, max(l_orderkey) as max_key from lineitem where l_orderkey
= 1000;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData3.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData3.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData3.sql
new file mode 100644
index 0000000..c6c23c6
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData3.sql
@@ -0,0 +1,3 @@
+select max(l_orderkey) as maximum, count(l_linenumber) as unique_key
+from lineitem
+where l_orderkey = 1000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData4.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData4.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData4.sql
new file mode 100644
index 0000000..ee345f9
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData4.sql
@@ -0,0 +1,3 @@
+select max(l_orderkey) as maximum, count(distinct l_linenumber) as unique_key
+from lineitem
+where l_orderkey = 1000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData5.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData5.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData5.sql
new file mode 100644
index 0000000..2247784
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData5.sql
@@ -0,0 +1 @@
+select count(1) as unique_key from table1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData6.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData6.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData6.sql
new file mode 100644
index 0000000..aea9c1c
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData6.sql
@@ -0,0 +1 @@
+select count(distinct age) as unique_key, max(point) as maximum from table1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData7.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData7.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData7.sql
new file mode 100644
index 0000000..bab8e23
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData7.sql
@@ -0,0 +1 @@
+select max(point) as maximum, count(distinct age) as unique_key from table1 where age >
100;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData8.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData8.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData8.sql
new file mode 100644
index 0000000..0bd8b53
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData8.sql
@@ -0,0 +1 @@
+select max(point) as maximum, count(age) as unique_key from table1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData9.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData9.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData9.sql
new file mode 100644
index 0000000..56fb65c
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithNullData9.sql
@@ -0,0 +1,4 @@
+select l_orderkey, count(distinct l_linenumber) as unique_key
+from lineitem
+where l_orderkey = 1000
+group by l_orderkey
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData1.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData1.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData1.result
new file mode 100644
index 0000000..13335cb
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData1.result
@@ -0,0 +1,3 @@
+unique_key
+-------------------------------
+0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData10.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData10.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData10.result
new file mode 100644
index 0000000..c865378
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData10.result
@@ -0,0 +1,3 @@
+unique_key,flag
+-------------------------------
+0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData11.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData11.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData11.result
new file mode 100644
index 0000000..bd69ff2
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData11.result
@@ -0,0 +1,2 @@
+l_orderkey,unique_key,flag
+-------------------------------
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData12.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData12.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData12.result
new file mode 100644
index 0000000..2b8b687
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData12.result
@@ -0,0 +1,2 @@
+s_acctbal,s_name,t_name,p_partkey,p_mfgr,s_address,s_phone,s_comment
+-------------------------------
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData2.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData2.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData2.result
new file mode 100644
index 0000000..f4f9a5b
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData2.result
@@ -0,0 +1,3 @@
+unique_key,max_key
+-------------------------------
+0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData3.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData3.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData3.result
new file mode 100644
index 0000000..fef3d0c
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData3.result
@@ -0,0 +1,3 @@
+maximum,unique_key
+-------------------------------
+0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData4.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData4.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData4.result
new file mode 100644
index 0000000..fef3d0c
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData4.result
@@ -0,0 +1,3 @@
+maximum,unique_key
+-------------------------------
+0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData5.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData5.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData5.result
new file mode 100644
index 0000000..13335cb
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData5.result
@@ -0,0 +1,3 @@
+unique_key
+-------------------------------
+0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData6.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData6.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData6.result
new file mode 100644
index 0000000..58aaa20
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData6.result
@@ -0,0 +1,3 @@
+unique_key,maximum
+-------------------------------
+0,0.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData7.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData7.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData7.result
new file mode 100644
index 0000000..e19a623
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData7.result
@@ -0,0 +1,3 @@
+maximum,unique_key
+-------------------------------
+0.0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData8.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData8.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData8.result
new file mode 100644
index 0000000..e19a623
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData8.result
@@ -0,0 +1,3 @@
+maximum,unique_key
+-------------------------------
+0.0,0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/f3092c42/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData9.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData9.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData9.result
new file mode 100644
index 0000000..1f6d988
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithNullData9.result
@@ -0,0 +1,2 @@
+l_orderkey,unique_key
+-------------------------------
\ No newline at end of file


Mime
View raw message