tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [8/8] tajo git commit: TAJO-1981: Invalid nulls sort order in VectorizedSorter.
Date Wed, 18 Nov 2015 12:14:45 GMT
TAJO-1981: Invalid nulls sort order in VectorizedSorter.


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

Branch: refs/heads/branch-0.11.1
Commit: 8209e4c86e410c5f8fd088d21fc5e5ce6f9398a9
Parents: a0fb954
Author: Jihoon Son <jihoonson@apache.org>
Authored: Wed Nov 18 21:14:20 2015 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Wed Nov 18 21:14:20 2015 +0900

----------------------------------------------------------------------
 CHANGES                                         |  2 +
 .../main/java/org/apache/tajo/algebra/Sort.java | 36 ++++++++-----
 .../org/apache/tajo/catalog/DDLBuilder.java     |  2 +-
 .../java/org/apache/tajo/catalog/IndexMeta.java |  2 +-
 .../java/org/apache/tajo/catalog/SortSpec.java  | 28 +++++-----
 .../org/apache/tajo/catalog/TestIndexDesc.java  |  4 +-
 .../tajo/catalog/store/AbstractDBStore.java     |  2 +-
 .../apache/tajo/engine/query/TestSortQuery.java | 56 ++++++++++++++++++++
 .../results/TestCaseByCases/testTAJO_1600.plan  |  2 +-
 .../TestCrossJoin/testCrossJoin.1.Hash.plan     |  6 +--
 .../testCrossJoin.1.Hash_NoBroadcast.plan       |  6 +--
 .../TestCrossJoin/testCrossJoin.1.Sort.plan     |  6 +--
 .../testCrossJoin.1.Sort_NoBroadcast.plan       |  6 +--
 .../TestCrossJoin/testCrossJoin.5.Hash.plan     |  6 +--
 .../testCrossJoin.5.Hash_NoBroadcast.plan       |  6 +--
 .../TestCrossJoin/testCrossJoin.5.Sort.plan     |  6 +--
 .../testCrossJoin.5.Sort_NoBroadcast.plan       |  6 +--
 .../testCrossJoinAndCaseWhen.Hash.plan          |  6 +--
 ...stCrossJoinAndCaseWhen.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinAndCaseWhen.Sort.plan          |  6 +--
 ...stCrossJoinAndCaseWhen.Sort_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk1.Hash.plan        |  6 +--
 ...CrossJoinWithAsterisk1.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk1.Sort.plan        |  6 +--
 ...CrossJoinWithAsterisk1.Sort_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk2.Hash.plan        |  6 +--
 ...CrossJoinWithAsterisk2.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk2.Sort.plan        |  6 +--
 ...CrossJoinWithAsterisk2.Sort_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk3.Hash.plan        |  6 +--
 ...CrossJoinWithAsterisk3.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk3.Sort.plan        |  6 +--
 ...CrossJoinWithAsterisk3.Sort_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk4.Hash.plan        |  6 +--
 ...CrossJoinWithAsterisk4.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithAsterisk4.Sort.plan        |  6 +--
 ...CrossJoinWithAsterisk4.Sort_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithEmptyTable1.Hash.plan      |  6 +--
 ...ossJoinWithEmptyTable1.Hash_NoBroadcast.plan |  6 +--
 .../testCrossJoinWithEmptyTable1.Sort.plan      |  6 +--
 ...ossJoinWithEmptyTable1.Sort_NoBroadcast.plan |  6 +--
 .../testBroadcastTwoPartJoin.Hash.plan          |  6 +--
 ...stBroadcastTwoPartJoin.Hash_NoBroadcast.plan |  6 +--
 .../testBroadcastTwoPartJoin.Sort.plan          |  6 +--
 ...stBroadcastTwoPartJoin.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition1.Hash.plan         |  6 +--
 ...tComplexJoinCondition1.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition1.Sort.plan         |  6 +--
 ...tComplexJoinCondition1.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition2.Hash.plan         |  6 +--
 ...tComplexJoinCondition2.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition2.Sort.plan         |  6 +--
 ...tComplexJoinCondition2.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition3.Hash.plan         |  6 +--
 ...tComplexJoinCondition3.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition3.Sort.plan         |  6 +--
 ...tComplexJoinCondition3.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition4.Hash.plan         |  6 +--
 ...tComplexJoinCondition4.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition4.Sort.plan         |  6 +--
 ...tComplexJoinCondition4.Sort_NoBroadcast.plan |  6 +--
 .../testInnerJoinAndCaseWhen.Hash.plan          |  6 +--
 ...stInnerJoinAndCaseWhen.Hash_NoBroadcast.plan |  6 +--
 .../testInnerJoinAndCaseWhen.Sort.plan          |  6 +--
 ...stInnerJoinAndCaseWhen.Sort_NoBroadcast.plan |  6 +--
 .../testInnerJoinWithEmptyTable.Hash.plan       |  6 +--
 ...nnerJoinWithEmptyTable.Hash_NoBroadcast.plan |  6 +--
 .../testInnerJoinWithEmptyTable.Sort.plan       |  6 +--
 ...nnerJoinWithEmptyTable.Sort_NoBroadcast.plan |  6 +--
 .../testJoinCoReferredEvals1.Hash.plan          |  6 +--
 ...stJoinCoReferredEvals1.Hash_NoBroadcast.plan |  6 +--
 .../testJoinCoReferredEvals1.Sort.plan          |  6 +--
 ...stJoinCoReferredEvals1.Sort_NoBroadcast.plan |  6 +--
 ...tJoinCoReferredEvalsWithSameExprs1.Hash.plan |  6 +--
 ...redEvalsWithSameExprs1.Hash_NoBroadcast.plan |  6 +--
 ...tJoinCoReferredEvalsWithSameExprs1.Sort.plan |  6 +--
 ...redEvalsWithSameExprs1.Sort_NoBroadcast.plan |  6 +--
 ...tJoinCoReferredEvalsWithSameExprs2.Hash.plan |  6 +--
 ...redEvalsWithSameExprs2.Hash_NoBroadcast.plan |  6 +--
 ...tJoinCoReferredEvalsWithSameExprs2.Sort.plan |  6 +--
 ...redEvalsWithSameExprs2.Sort_NoBroadcast.plan |  6 +--
 .../testJoinOnMultipleDatabases.Hash.plan       |  6 +--
 ...oinOnMultipleDatabases.Hash_NoBroadcast.plan |  6 +--
 .../testJoinOnMultipleDatabases.Sort.plan       |  6 +--
 ...oinOnMultipleDatabases.Sort_NoBroadcast.plan |  6 +--
 .../testJoinWithMultipleJoinQual1.Hash.plan     |  6 +--
 ...nWithMultipleJoinQual1.Hash_NoBroadcast.plan |  6 +--
 .../testJoinWithMultipleJoinQual1.Sort.plan     |  6 +--
 ...nWithMultipleJoinQual1.Sort_NoBroadcast.plan |  6 +--
 .../testJoinWithOrPredicates.Hash.plan          |  6 +--
 ...stJoinWithOrPredicates.Hash_NoBroadcast.plan |  6 +--
 .../testJoinWithOrPredicates.Sort.plan          |  6 +--
 ...stJoinWithOrPredicates.Sort_NoBroadcast.plan |  6 +--
 .../testNaturalJoin.Hash.plan                   |  6 +--
 .../testNaturalJoin.Hash_NoBroadcast.plan       |  6 +--
 .../testNaturalJoin.Sort.plan                   |  6 +--
 .../testNaturalJoin.Sort_NoBroadcast.plan       |  6 +--
 .../TestInnerJoinQuery/testTPCHQ2Join.Hash.plan |  6 +--
 .../testTPCHQ2Join.Hash_NoBroadcast.plan        |  6 +--
 .../TestInnerJoinQuery/testTPCHQ2Join.Sort.plan |  6 +--
 .../testTPCHQ2Join.Sort_NoBroadcast.plan        |  6 +--
 .../testWhereClauseJoin1.Hash.plan              |  6 +--
 .../testWhereClauseJoin1.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin1.Sort.plan              |  6 +--
 .../testWhereClauseJoin1.Sort_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin2.Hash.plan              |  6 +--
 .../testWhereClauseJoin2.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin2.Sort.plan              |  6 +--
 .../testWhereClauseJoin2.Sort_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin3.Hash.plan              |  6 +--
 .../testWhereClauseJoin3.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin3.Sort.plan              |  6 +--
 .../testWhereClauseJoin3.Sort_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin4.Hash.plan              |  6 +--
 .../testWhereClauseJoin4.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin4.Sort.plan              |  6 +--
 .../testWhereClauseJoin4.Sort_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin5.Hash.plan              |  6 +--
 .../testWhereClauseJoin5.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin5.Sort.plan              |  6 +--
 .../testWhereClauseJoin5.Sort_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin6.Hash.plan              |  6 +--
 .../testWhereClauseJoin6.Hash_NoBroadcast.plan  |  6 +--
 .../testWhereClauseJoin6.Sort.plan              |  6 +--
 .../testWhereClauseJoin6.Sort_NoBroadcast.plan  |  6 +--
 .../testBroadcastSubquery.Hash.plan             |  6 +--
 .../testBroadcastSubquery.Hash_NoBroadcast.plan |  6 +--
 .../testBroadcastSubquery.Sort.plan             |  6 +--
 .../testBroadcastSubquery.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition5.Hash.plan         |  6 +--
 ...tComplexJoinCondition5.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition5.Sort.plan         |  6 +--
 ...tComplexJoinCondition5.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition6.Hash.plan         |  6 +--
 ...tComplexJoinCondition6.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition6.Sort.plan         |  6 +--
 ...tComplexJoinCondition6.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition7.Hash.plan         |  6 +--
 ...tComplexJoinCondition7.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinCondition7.Sort.plan         |  6 +--
 ...tComplexJoinCondition7.Sort_NoBroadcast.plan |  6 +--
 .../testThetaJoinKeyPairs.Hash.plan             |  6 +--
 .../testThetaJoinKeyPairs.Hash_NoBroadcast.plan |  6 +--
 .../testThetaJoinKeyPairs.Sort.plan             |  6 +--
 .../testThetaJoinKeyPairs.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinsWithCaseWhen.Hash.plan      |  6 +--
 ...mplexJoinsWithCaseWhen.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinsWithCaseWhen.Sort.plan      |  6 +--
 ...mplexJoinsWithCaseWhen.Sort_NoBroadcast.plan |  6 +--
 .../testComplexJoinsWithCaseWhen2.Hash.plan     |  6 +--
 ...plexJoinsWithCaseWhen2.Hash_NoBroadcast.plan |  6 +--
 .../testComplexJoinsWithCaseWhen2.Sort.plan     |  6 +--
 ...plexJoinsWithCaseWhen2.Sort_NoBroadcast.plan |  6 +--
 .../testFullOuterJoin1.Hash.plan                |  6 +--
 .../testFullOuterJoin1.Hash_NoBroadcast.plan    |  6 +--
 .../testFullOuterJoin1.Sort.plan                |  6 +--
 .../testFullOuterJoin1.Sort_NoBroadcast.plan    |  6 +--
 ...lOuterJoinPredicationCaseByCase1.1.Hash.plan |  6 +--
 ...edicationCaseByCase1.1.Hash_NoBroadcast.plan |  6 +--
 ...lOuterJoinPredicationCaseByCase1.1.Sort.plan |  6 +--
 ...edicationCaseByCase1.1.Sort_NoBroadcast.plan |  6 +--
 .../testFullOuterJoinWithEmptyTable1.Hash.plan  |  6 +--
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  6 +--
 .../testFullOuterJoinWithEmptyTable1.Sort.plan  |  6 +--
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  6 +--
 ...testJoinFilterOfRowPreservedTable1.Hash.plan |  6 +--
 ...erOfRowPreservedTable1.Hash_NoBroadcast.plan |  6 +--
 ...testJoinFilterOfRowPreservedTable1.Sort.plan |  6 +--
 ...erOfRowPreservedTable1.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoin1.Hash.plan                |  6 +--
 .../testLeftOuterJoin1.Hash_NoBroadcast.plan    |  6 +--
 .../testLeftOuterJoin1.Sort.plan                |  6 +--
 .../testLeftOuterJoin1.Sort_NoBroadcast.plan    |  6 +--
 ...tLeftOuterJoinLeftSideSmallTable.1.Hash.plan |  6 +--
 ...inLeftSideSmallTable.1.Hash_NoBroadcast.plan |  6 +--
 ...tLeftOuterJoinLeftSideSmallTable.1.Sort.plan |  6 +--
 ...inLeftSideSmallTable.1.Sort_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr1.Hash.plan |  6 +--
 ...rJoinWithConstantExpr1.Hash_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr1.Sort.plan |  6 +--
 ...rJoinWithConstantExpr1.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable1.Hash.plan  |  6 +--
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable1.Sort.plan  |  6 +--
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable2.Hash.plan  |  6 +--
 ...terJoinWithEmptyTable2.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable2.Sort.plan  |  6 +--
 ...terJoinWithEmptyTable2.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable3.Hash.plan  |  6 +--
 ...terJoinWithEmptyTable3.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable3.Sort.plan  |  6 +--
 ...terJoinWithEmptyTable3.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable5.Hash.plan  |  6 +--
 ...terJoinWithEmptyTable5.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithEmptyTable5.Sort.plan  |  6 +--
 ...terJoinWithEmptyTable5.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull1.Hash.plan        |  6 +--
 ...LeftOuterJoinWithNull1.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull1.Sort.plan        |  6 +--
 ...LeftOuterJoinWithNull1.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull2.Hash.plan        |  6 +--
 ...LeftOuterJoinWithNull2.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull2.Sort.plan        |  6 +--
 ...LeftOuterJoinWithNull2.Sort_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull3.Hash.plan        |  6 +--
 ...LeftOuterJoinWithNull3.Hash_NoBroadcast.plan |  6 +--
 .../testLeftOuterJoinWithNull3.Sort.plan        |  6 +--
 ...LeftOuterJoinWithNull3.Sort_NoBroadcast.plan |  6 +--
 .../testOuterJoinAndCaseWhen1.Hash.plan         |  6 +--
 ...tOuterJoinAndCaseWhen1.Hash_NoBroadcast.plan |  6 +--
 .../testOuterJoinAndCaseWhen1.Sort.plan         |  6 +--
 ...tOuterJoinAndCaseWhen1.Sort_NoBroadcast.plan |  6 +--
 .../testRightOuterJoin1.Hash.plan               |  6 +--
 .../testRightOuterJoin1.Hash_NoBroadcast.plan   |  6 +--
 .../testRightOuterJoin1.Sort.plan               |  6 +--
 .../testRightOuterJoin1.Sort_NoBroadcast.plan   |  6 +--
 .../testRightOuterJoinWithEmptyTable1.Hash.plan |  6 +--
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  6 +--
 .../testRightOuterJoinWithEmptyTable1.Sort.plan |  6 +--
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr2.Hash.plan |  6 +--
 ...rJoinWithConstantExpr2.Hash_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr2.Sort.plan |  6 +--
 ...rJoinWithConstantExpr2.Sort_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr3.Hash.plan |  6 +--
 ...rJoinWithConstantExpr3.Hash_NoBroadcast.plan |  6 +--
 ...testLeftOuterJoinWithConstantExpr3.Sort.plan |  6 +--
 ...rJoinWithConstantExpr3.Sort_NoBroadcast.plan |  6 +--
 ...tLeftOuterJoinWithEmptySubquery1.1.Hash.plan |  6 +--
 ...inWithEmptySubquery1.1.Hash_NoBroadcast.plan |  6 +--
 ...tLeftOuterJoinWithEmptySubquery1.1.Sort.plan |  6 +--
 ...inWithEmptySubquery1.1.Sort_NoBroadcast.plan |  6 +--
 .../results/TestSQLAnalyzer/window4.result      |  3 +-
 .../results/TestSQLAnalyzer/window5.result      |  2 +-
 .../results/TestSQLAnalyzer/window6.result      |  2 +-
 .../results/TestSQLAnalyzer/window7.result      |  2 +-
 .../results/TestSQLAnalyzer/window8.result      |  2 +-
 .../testExplainSelectPhysical.2.result          |  4 +-
 .../testSubQuerySortAfterGroupMultiBlocks.plan  |  6 +--
 .../results/TestTPCH/testQ1OrderBy.plan         |  6 +--
 .../resources/results/TestTPCH/testTPCHQ5.plan  |  6 +--
 .../planner/physical/ComparableVector.java      | 15 +++---
 .../org/apache/tajo/engine/utils/TupleUtil.java |  9 ++--
 .../org/apache/tajo/parser/sql/SQLAnalyzer.java |  4 +-
 .../org/apache/tajo/plan/LogicalPlanner.java    |  4 +-
 .../rewrite/rules/ProjectionPushDownRule.java   |  4 +-
 .../tajo/storage/BaseTupleComparator.java       |  3 +-
 248 files changed, 807 insertions(+), 743 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index b89e3d8..0ebb96c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,8 @@ Release 0.11.1 - unreleased
 
   BUG FIXES
 
+    TAJO-1981: Invalid nulls sort order in VectorizedSorter. (jihoon)
+
     TAJO-1935: Some Tasks don't work after they become TA_ASSIGNED. (jinho)
 
     TAJO-1977: Cannot recognize the space-contained tablename and databasename.

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-algebra/src/main/java/org/apache/tajo/algebra/Sort.java
----------------------------------------------------------------------
diff --git a/tajo-algebra/src/main/java/org/apache/tajo/algebra/Sort.java b/tajo-algebra/src/main/java/org/apache/tajo/algebra/Sort.java
index 7d5cb55..84112ef 100644
--- a/tajo-algebra/src/main/java/org/apache/tajo/algebra/Sort.java
+++ b/tajo-algebra/src/main/java/org/apache/tajo/algebra/Sort.java
@@ -71,8 +71,10 @@ public class Sort extends UnaryOperator {
     private Expr key;
     @Expose @SerializedName("IsAsc")
     private boolean asc = true;
-    @Expose @SerializedName("IsNullFirst")
-    private boolean nullFirst = false;
+    @Expose @SerializedName("IsNullsFirst")
+    // The default value for nulls order is decided based on the sort order.
+    // That is, nulls appear at the bottom with asc and the top with desc.
+    private Boolean nullsFirst = null;
 
     public SortSpec(final Expr key) {
       this.key = key;
@@ -82,14 +84,14 @@ public class Sort extends UnaryOperator {
      *
      * @param sortKey a column to sort
      * @param asc true if the sort order is ascending order
-     * @param nullFirst
+     * @param nullsFirst
      * Otherwise, it should be false.
      */
     public SortSpec(final ColumnReferenceExpr sortKey, final boolean asc,
-                    final boolean nullFirst) {
+                    final boolean nullsFirst) {
       this(sortKey);
       this.asc = asc;
-      this.nullFirst = nullFirst;
+      this.nullsFirst = nullsFirst;
     }
 
     public final boolean isAscending() {
@@ -100,12 +102,20 @@ public class Sort extends UnaryOperator {
       this.asc = false;
     }
 
-    public final boolean isNullFirst() {
-      return this.nullFirst;
+    public final boolean isNullsFirst() {
+      if (nullsFirst == null) {
+        return !asc;
+      } else {
+        return nullsFirst;
+      }
+    }
+
+    public final void setNullsFirst() {
+      this.nullsFirst = true;
     }
 
-    public final void setNullFirst() {
-      this.nullFirst = true;
+    public final void setNullsLast() {
+      this.nullsFirst = false;
     }
 
     public void setKey(Expr expr) {
@@ -118,7 +128,7 @@ public class Sort extends UnaryOperator {
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(asc, key, nullFirst);
+      return Objects.hashCode(asc, key, nullsFirst);
     }
 
     @Override
@@ -127,14 +137,14 @@ public class Sort extends UnaryOperator {
         SortSpec other = (SortSpec) obj;
         return TUtil.checkEquals(key, other.key) &&
             TUtil.checkEquals(asc, other.asc) &&
-            TUtil.checkEquals(nullFirst, other.nullFirst);
+            TUtil.checkEquals(nullsFirst, other.nullsFirst);
       }
       return false;
     }
 
     @Override
     public String toString() {
-      return key + " " + (asc ? "asc" : "desc") + " " + (nullFirst ? "null first" :"");
+      return key + " " + (asc ? "asc" : "desc") + " " + (isNullsFirst() ? "nulls first" : "nulls last");
     }
 
     @Override
@@ -142,7 +152,7 @@ public class Sort extends UnaryOperator {
       SortSpec sortSpec = (SortSpec) super.clone();
       sortSpec.key = (Expr) key.clone();
       sortSpec.asc = asc;
-      sortSpec.nullFirst = nullFirst;
+      sortSpec.nullsFirst = nullsFirst;
       return sortSpec;
     }
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
index 4b56e8c..cd9038d 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
@@ -87,7 +87,7 @@ public class DDLBuilder {
     for (SortSpec sortSpec : desc.getKeySortSpecs()) {
       sb.append(sortSpec.getSortKey().getQualifiedName()).append(" ");
       sb.append(sortSpec.isAscending() ? "asc" : "desc").append(" ");
-      sb.append(sortSpec.isNullFirst() ? "null first" : "null last").append(", ");
+      sb.append(sortSpec.isNullsFirst() ? "null first" : "null last").append(", ");
     }
     sb.replace(sb.length() - 2, sb.length() - 1, " )");
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexMeta.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexMeta.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexMeta.java
index a911055..89c72e5 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexMeta.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexMeta.java
@@ -64,7 +64,7 @@ public class IndexMeta implements Cloneable {
     this.keySortSpecs = new SortSpec[keySortSpecs.length];
     for (int i = 0; i < keySortSpecs.length; i++) {
       this.keySortSpecs[i] = new SortSpec(keySortSpecs[i].getSortKey(), keySortSpecs[i].isAscending(),
-          keySortSpecs[i].isNullFirst());
+          keySortSpecs[i].isNullsFirst());
     }
     Arrays.sort(this.keySortSpecs, new Comparator<SortSpec>() {
       @Override

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SortSpec.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SortSpec.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SortSpec.java
index 5b10dfd..0966169 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SortSpec.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SortSpec.java
@@ -30,7 +30,7 @@ import static org.apache.tajo.catalog.proto.CatalogProtos.SortSpecProto;
 public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProto> {
   @Expose private Column sortKey;
   @Expose private boolean ascending = true;
-  @Expose private boolean nullFirst = false;
+  @Expose private boolean nullsFirst = false;
 
   public SortSpec(final Column sortKey) {
     this.sortKey = sortKey;
@@ -40,19 +40,19 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
    *
    * @param sortKey columns to sort
    * @param asc true if the sort order is ascending order
-   * @param nullFirst
+   * @param nullsFirst
    * Otherwise, it should be false.
    */
-  public SortSpec(final Column sortKey, final boolean asc, final boolean nullFirst) {
+  public SortSpec(final Column sortKey, final boolean asc, final boolean nullsFirst) {
     this(sortKey);
     this.ascending = asc;
-    this.nullFirst = nullFirst;
+    this.nullsFirst = nullsFirst;
   }
 
   public SortSpec(SortSpecProto sortSpec) {
     this.sortKey = new Column(sortSpec.getColumn());
     this.ascending = sortSpec.getAscending();
-    this.nullFirst = sortSpec.getNullFirst();
+    this.nullsFirst = sortSpec.getNullFirst();
   }
 
   public final boolean isAscending() {
@@ -63,12 +63,12 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
     this.ascending = false;
   }
 
-  public final boolean isNullFirst() {
-    return this.nullFirst;
+  public final boolean isNullsFirst() {
+    return this.nullsFirst;
   }
 
-  public final void setNullFirst() {
-    this.nullFirst = true;
+  public final void setNullsFirst() {
+    this.nullsFirst = true;
   }
 
   public final Column getSortKey() {
@@ -80,14 +80,14 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
     SortSpec key = (SortSpec) super.clone();
     key.sortKey = sortKey;
     key.ascending = ascending;
-    key.nullFirst = nullFirst;
+    key.nullsFirst = nullsFirst;
 
     return key;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(Objects.hashCode(sortKey), ascending, nullFirst);
+    return Objects.hashCode(Objects.hashCode(sortKey), ascending, nullsFirst);
   }
 
   @Override
@@ -96,7 +96,7 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
       SortSpec other = (SortSpec) object;
       return sortKey.equals(other.sortKey) &&
           ascending == other.ascending &&
-          nullFirst == other.nullFirst;
+          nullsFirst == other.nullsFirst;
     } else {
       return false;
     }
@@ -108,7 +108,7 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
   }
 
   public String toString() {
-    return sortKey + " ("+(ascending ? "asc" : "desc")+")";
+    return sortKey + " ("+(ascending ? "asc" : "desc") + ", " + (nullsFirst ? "nulls first" : "nulls last") +")";
   }
 
   @Override
@@ -116,7 +116,7 @@ public class SortSpec implements Cloneable, GsonObject, ProtoObject<SortSpecProt
     SortSpecProto.Builder builder = SortSpecProto.newBuilder();
     builder.setColumn(sortKey.getProto());
     builder.setAscending(ascending);
-    builder.setNullFirst(nullFirst);
+    builder.setNullFirst(nullsFirst);
     return builder.build();
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestIndexDesc.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestIndexDesc.java b/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestIndexDesc.java
index 247cd41..7561dfd 100644
--- a/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestIndexDesc.java
+++ b/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestIndexDesc.java
@@ -79,7 +79,7 @@ public class TestIndexDesc {
     assertEquals(1, desc1.getKeySortSpecs().length);
     assertEquals(new Column("id", Type.INT4), desc1.getKeySortSpecs()[0].getSortKey());
     assertEquals(true, desc1.getKeySortSpecs()[0].isAscending());
-    assertEquals(true, desc1.getKeySortSpecs()[0].isNullFirst());
+    assertEquals(true, desc1.getKeySortSpecs()[0].isNullsFirst());
     assertEquals(IndexMethod.TWO_LEVEL_BIN_TREE, desc1.getIndexMethod());
     assertEquals(new URI("idx_test"), desc1.getIndexPath());
     assertEquals(true, desc1.isUnique());
@@ -90,7 +90,7 @@ public class TestIndexDesc {
     assertEquals(1, desc2.getKeySortSpecs().length);
     assertEquals(new Column("score", Type.FLOAT8), desc2.getKeySortSpecs()[0].getSortKey());
     assertEquals(false, desc2.getKeySortSpecs()[0].isAscending());
-    assertEquals(false, desc2.getKeySortSpecs()[0].isNullFirst());
+    assertEquals(false, desc2.getKeySortSpecs()[0].isNullsFirst());
     assertEquals(IndexMethod.TWO_LEVEL_BIN_TREE, desc2.getIndexMethod());
     assertEquals(new URI("idx_test2"), desc2.getIndexPath());
     assertEquals(false, desc2.isUnique());

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
index 4038c9d..1360c68 100644
--- a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
+++ b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
@@ -2435,7 +2435,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements Catalo
         columnNamesBuilder.append(columnSpec.getSortKey().getSimpleName()).append(",");
         dataTypesBuilder.append(columnSpec.getSortKey().getDataType().getType().name()).append(",");
         ordersBuilder.append(columnSpec.isAscending()).append(",");
-        nullOrdersBuilder.append(columnSpec.isNullFirst()).append(",");
+        nullOrdersBuilder.append(columnSpec.isNullsFirst()).append(",");
       }
       columnNamesBuilder.deleteCharAt(columnNamesBuilder.length()-1);
       dataTypesBuilder.deleteCharAt(dataTypesBuilder.length()-1);

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java
index ebfedd1..d889d34 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java
@@ -299,6 +299,62 @@ public class TestSortQuery extends QueryTestCaseBase {
   }
 
   @Test
+  public final void testSortOnNullColumn4() throws Exception {
+    KeyValueSet tableOptions = new KeyValueSet();
+    tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
+    tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
+
+    Schema schema = new Schema();
+    schema.addColumn("id", Type.INT4);
+    schema.addColumn("name", Type.TEXT);
+    String[] data = new String[]{ "1|111", "2|\\N", "3|333" };
+    TajoTestingCluster.createTable("testSortOnNullColumn4".toLowerCase(), schema, tableOptions, data, 1);
+
+    try {
+      ResultSet res = executeString("select * from testSortOnNullColumn4 order by name desc nulls last");
+      String ascExpected = "id,name\n" +
+          "-------------------------------\n" +
+          "3,333\n" +
+          "1,111\n" +
+          "2,null\n";
+
+      assertEquals(ascExpected, resultSetToString(res));
+      res.close();
+
+    } finally {
+      executeString("DROP TABLE testSortOnNullColumn4 PURGE");
+    }
+  }
+
+  @Test
+  public final void testSortOnNullColumn5() throws Exception {
+    KeyValueSet tableOptions = new KeyValueSet();
+    tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
+    tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N");
+
+    Schema schema = new Schema();
+    schema.addColumn("id", Type.INT4);
+    schema.addColumn("name", Type.TEXT);
+    String[] data = new String[]{ "1|111", "2|\\N", "3|333" };
+    TajoTestingCluster.createTable("testSortOnNullColumn5".toLowerCase(), schema, tableOptions, data, 1);
+
+    try {
+      ResultSet res = executeString("select * from testSortOnNullColumn5 order by name asc nulls first");
+      String ascExpected = "id,name\n" +
+          "-------------------------------\n" +
+          "2,null\n" +
+          "1,111\n" +
+          "3,333\n";
+
+      assertEquals(ascExpected, resultSetToString(res));
+      res.close();
+
+    } finally {
+      executeString("DROP TABLE testSortOnNullColumn5 PURGE");
+    }
+  }
+
+  @Test
   public final void testSortOnUnicodeTextAsc() throws Exception {
     try {
       testingCluster.setAllTajoDaemonConfValue(ConfVars.$TEST_MIN_TASK_NUM.varname, "2");

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCaseByCases/testTAJO_1600.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCaseByCases/testTAJO_1600.plan b/tajo-core-tests/src/test/resources/results/TestCaseByCases/testTAJO_1600.plan
index 12921cd..3c3c3e9 100644
--- a/tajo-core-tests/src/test/resources/results/TestCaseByCases/testTAJO_1600.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCaseByCases/testTAJO_1600.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(3)
-  => Sort Keys: default.customer.c_custkey (INT4) (asc),default.orders.o_orderkey (INT4) (asc)
+  => Sort Keys: default.customer.c_custkey (INT4) (asc, nulls last),default.orders.o_orderkey (INT4) (asc, nulls last)
    GROUP_BY(5)(c_custkey,o_orderkey,o_orderstatus,o_orderdate)
      => target list: default.customer.c_custkey (INT4), default.orders.o_orderkey (INT4), default.orders.o_orderstatus (TEXT), default.orders.o_orderdate (TEXT)
      => out schema:{(4) default.customer.c_custkey (INT4), default.orders.o_orderdate (TEXT), default.orders.o_orderkey (INT4), default.orders.o_orderstatus (TEXT)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash.plan
index 0fb22b3..1a03308 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash_NoBroadcast.plan
index 4278681..c91a98e 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Hash_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.nation.n_name (TEXT), default.region.r_name (TEXT), num=32)
 
 SORT(10)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort.plan
index 0fb22b3..1a03308 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort_NoBroadcast.plan
index 4278681..c91a98e 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.1.Sort_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.nation.n_name (TEXT), default.region.r_name (TEXT), num=32)
 
 SORT(10)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.nation.n_name (TEXT) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: default.nation.n_name (TEXT) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(4) default.nation.n_name (TEXT), default.nation.n_regionkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash.plan
index 35e397b..913a90e 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
      => in schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash_NoBroadcast.plan
index 243acc2..5289dba 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Hash_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4), num=32)
 
 SORT(10)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
      => in schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort.plan
index 35e397b..913a90e 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
      => in schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort_NoBroadcast.plan
index 243acc2..5289dba 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoin.5.Sort_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4), num=32)
 
 SORT(10)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: len (INT4) (asc),default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc)
+  => Sort Keys: len (INT4) (asc, nulls last),default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}
      => in schema: {(13) ?multiply (INT4), default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), len (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash.plan
index de4fc4f..8015b51 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -42,7 +42,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(11)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -68,7 +68,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    SCAN(12) on eb_0000000000000_0000_000003
      => out schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}
      => in schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash_NoBroadcast.plan
index 6153908..40dfe18 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Hash_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -71,7 +71,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4), num=32)
 
 SORT(11)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -95,7 +95,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    SCAN(12) on eb_0000000000000_0000_000003
      => out schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}
      => in schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort.plan
index de4fc4f..8015b51 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -42,7 +42,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(11)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -68,7 +68,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    SCAN(12) on eb_0000000000000_0000_000003
      => out schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}
      => in schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort_NoBroadcast.plan
index 6153908..40dfe18 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinAndCaseWhen.Sort_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -71,7 +71,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4), num=32)
 
 SORT(11)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    JOIN(7)(INNER)
      => Join Cond: default.region.r_regionkey (INT4) = default.nation.n_regionkey (INT4)
      => target list: cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)
@@ -95,7 +95,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(3)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.nation.n_regionkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.nation.n_regionkey (INT4) (asc, nulls last)
    SCAN(12) on eb_0000000000000_0000_000003
      => out schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}
      => in schema: {(3) cond (TEXT), default.nation.n_regionkey (INT4), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash.plan
index 78b074a..7d34a1d 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash_NoBroadcast.plan
index 214097c..be0ed30 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Hash_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.customer.c_custkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4), num=32)
 
 SORT(10)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort.plan
index 78b074a..7d34a1d 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -41,7 +41,7 @@ Block Id: eb_0000000000000_0000_000003 [LEAF]
  0: type=Broadcast, tables=default.region
 
 SORT(10)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -66,7 +66,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}

http://git-wip-us.apache.org/repos/asf/tajo/blob/8209e4c8/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort_NoBroadcast.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort_NoBroadcast.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort_NoBroadcast.plan
index 214097c..be0ed30 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort_NoBroadcast.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinWithAsterisk1.Sort_NoBroadcast.plan
@@ -1,7 +1,7 @@
 explain
 -------------------------------
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -70,7 +70,7 @@ Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
 [q_0000000000000_0000] 3 => 4 (type=RANGE_SHUFFLE, key=default.customer.c_custkey (INT4), default.region.r_name (TEXT), default.region.r_regionkey (INT4), num=32)
 
 SORT(10)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    JOIN(6)(CROSS)
      => target list: default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
@@ -93,7 +93,7 @@ Block Id: eb_0000000000000_0000_000004 [ROOT]
  0: sorted input=eb_0000000000000_0000_000003
 
 SORT(2)
-  => Sort Keys: default.region.r_regionkey (INT4) (asc),default.region.r_name (TEXT) (asc),default.customer.c_custkey (INT4) (asc)
+  => Sort Keys: default.region.r_regionkey (INT4) (asc, nulls last),default.region.r_name (TEXT) (asc, nulls last),default.customer.c_custkey (INT4) (asc, nulls last)
    SCAN(11) on eb_0000000000000_0000_000003
      => out schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
      => in schema: {(11) default.customer.c_acctbal (FLOAT8), default.customer.c_address (TEXT), default.customer.c_comment (TEXT), default.customer.c_custkey (INT4), default.customer.c_mktsegment (TEXT), default.customer.c_name (TEXT), default.customer.c_nationkey (INT4), default.customer.c_phone (TEXT), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}


Mime
View raw message