You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2015/09/22 01:03:16 UTC

[4/8] hive git commit: HIVE-11843: Add 'sort by c' to Parquet PPD q-tests to avoid different output issues with hadoop-1 (Sergio Pena, reviewed by Ferdinand Xu)

HIVE-11843: Add 'sort by c' to Parquet PPD q-tests to avoid different output issues with hadoop-1 (Sergio Pena, reviewed by Ferdinand Xu)


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

Branch: refs/heads/llap
Commit: 92b42ae9efaa2da352c123a0bb74adf2d3ea267d
Parents: 2186159
Author: Sergio Pena <se...@cloudera.com>
Authored: Mon Sep 21 10:06:10 2015 -0500
Committer: Sergio Pena <se...@cloudera.com>
Committed: Mon Sep 21 10:06:10 2015 -0500

----------------------------------------------------------------------
 .../clientpositive/parquet_ppd_boolean.q        |   4 +-
 .../queries/clientpositive/parquet_ppd_char.q   |  12 +-
 .../queries/clientpositive/parquet_ppd_date.q   |  16 +-
 .../clientpositive/parquet_ppd_decimal.q        |  32 +--
 .../clientpositive/parquet_ppd_timestamp.q      |  16 +-
 .../clientpositive/parquet_ppd_varchar.q        |  12 +-
 .../clientpositive/parquet_ppd_boolean.q.out    |  28 +--
 .../clientpositive/parquet_ppd_char.q.out       |  84 +++----
 .../clientpositive/parquet_ppd_date.q.out       | 112 +++++-----
 .../clientpositive/parquet_ppd_decimal.q.out    | 224 +++++++++----------
 .../clientpositive/parquet_ppd_timestamp.q.out  | 112 +++++-----
 .../clientpositive/parquet_ppd_varchar.q.out    |  84 +++----
 12 files changed, 368 insertions(+), 368 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_boolean.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_boolean.q b/ql/src/test/queries/clientpositive/parquet_ppd_boolean.q
index a7848b4..059da68 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_boolean.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_boolean.q
@@ -12,7 +12,7 @@ select * from newtypestbl where b=true;
 select * from newtypestbl where b!=true;
 select * from newtypestbl where b<true;
 select * from newtypestbl where b>true;
-select * from newtypestbl where b<=true;
+select * from newtypestbl where b<=true sort by c;
 
 select * from newtypestbl where b=false;
 select * from newtypestbl where b!=false;
@@ -26,7 +26,7 @@ select * from newtypestbl where b=true;
 select * from newtypestbl where b!=true;
 select * from newtypestbl where b<true;
 select * from newtypestbl where b>true;
-select * from newtypestbl where b<=true;
+select * from newtypestbl where b<=true sort by c;
 
 select * from newtypestbl where b=false;
 select * from newtypestbl where b!=false;

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_char.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_char.q b/ql/src/test/queries/clientpositive/parquet_ppd_char.q
index dcad622..eaddcb4 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_char.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_char.q
@@ -28,10 +28,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where c<"hello";
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where c<="hello";
+select * from newtypestbl where c<="hello" sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where c<="hello";
+select * from newtypestbl where c<="hello" sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where c="apple ";
@@ -46,10 +46,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where c in ("apple", "carrot");
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where c in ("apple", "hello");
+select * from newtypestbl where c in ("apple", "hello") sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where c in ("apple", "hello");
+select * from newtypestbl where c in ("apple", "hello") sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where c in ("carrot");
@@ -64,10 +64,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where c between "apple" and "carrot";
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where c between "apple" and "zombie";
+select * from newtypestbl where c between "apple" and "zombie" sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where c between "apple" and "zombie";
+select * from newtypestbl where c between "apple" and "zombie" sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where c between "carrot" and "carrot1";

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_date.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_date.q b/ql/src/test/queries/clientpositive/parquet_ppd_date.q
index a05d358..41d0d64 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_date.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_date.q
@@ -41,10 +41,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where da<'1970-02-27';
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where da<'1970-02-29';
+select * from newtypestbl where da<'1970-02-29' sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where da<'1970-02-29';
+select * from newtypestbl where da<'1970-02-29' sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where da<'1970-02-15';
@@ -59,10 +59,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where da<='1970-02-20';
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where da<='1970-02-27';
+select * from newtypestbl where da<='1970-02-27' sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where da<='1970-02-27';
+select * from newtypestbl where da<='1970-02-27' sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where da in (cast('1970-02-21' as date), cast('1970-02-27' as date));
@@ -71,10 +71,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where da in (cast('1970-02-21' as date), cast('1970-02-27' as date));
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date));
+select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date));
+select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where da in (cast('1970-02-21' as date), cast('1970-02-22' as date));
@@ -89,10 +89,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where da between '1970-02-19' and '1970-02-22';
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where da between '1970-02-19' and '1970-02-28';
+select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where da between '1970-02-19' and '1970-02-28';
+select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where da between '1970-02-18' and '1970-02-19';

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_decimal.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_decimal.q b/ql/src/test/queries/clientpositive/parquet_ppd_decimal.q
index cf7cba0..dfca486 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_decimal.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_decimal.q
@@ -67,22 +67,22 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where d<1;
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d<=11.22;
+select * from newtypestbl where d<=11.22 sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d<=11.22;
+select * from newtypestbl where d<=11.22 sort by c;
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d<='11.22';
+select * from newtypestbl where d<='11.22' sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d<='11.22';
+select * from newtypestbl where d<='11.22' sort by c;
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d<=cast('11.22' as float);
+select * from newtypestbl where d<=cast('11.22' as float) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d<=cast('11.22' as float);
+select * from newtypestbl where d<=cast('11.22' as float) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where d<=cast('11.22' as decimal);
@@ -91,16 +91,16 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where d<=cast('11.22' as decimal);
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d<=11.22BD;
+select * from newtypestbl where d<=11.22BD sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d<=11.22BD;
+select * from newtypestbl where d<=11.22BD sort by c;
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d<=12;
+select * from newtypestbl where d<=12 sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d<=12;
+select * from newtypestbl where d<=12 sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where d in ('0.22', '1.0');
@@ -109,10 +109,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where d in ('0.22', '1.0');
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d in ('0.22', '11.22');
+select * from newtypestbl where d in ('0.22', '11.22') sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d in ('0.22', '11.22');
+select * from newtypestbl where d in ('0.22', '11.22') sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where d in ('0.9', '1.0');
@@ -127,10 +127,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where d in ('0.9', 0.22);
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float));
+select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float));
+select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where d between 0 and 1;
@@ -139,10 +139,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where d between 0 and 1;
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where d between 0 and 1000;
+select * from newtypestbl where d between 0 and 1000 sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where d between 0 and 1000;
+select * from newtypestbl where d between 0 and 1000 sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where d between 0 and '2.0';

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_timestamp.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_timestamp.q b/ql/src/test/queries/clientpositive/parquet_ppd_timestamp.q
index 6ed1e55..1b9f6ff 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_timestamp.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_timestamp.q
@@ -38,10 +38,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where ts<cast('2011-01-20 01:01:01' as timestamp);
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp);
+select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp);
+select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where ts<cast('2010-10-01 01:01:01' as timestamp);
@@ -56,10 +56,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where ts<=cast('2011-01-01 01:01:01' as timestamp);
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp);
+select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp);
+select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp));
@@ -68,10 +68,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp));
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp));
+select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp));
+select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-08 01:01:01' as timestamp));
@@ -86,10 +86,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-08 01:01:01' as timestamp);
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp);
+select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp);
+select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2010-11-01 01:01:01' as timestamp);

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/queries/clientpositive/parquet_ppd_varchar.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/parquet_ppd_varchar.q b/ql/src/test/queries/clientpositive/parquet_ppd_varchar.q
index 41bf7df..6449c6d 100644
--- a/ql/src/test/queries/clientpositive/parquet_ppd_varchar.q
+++ b/ql/src/test/queries/clientpositive/parquet_ppd_varchar.q
@@ -28,10 +28,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where v<"world";
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where v<="world";
+select * from newtypestbl where v<="world" sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where v<="world";
+select * from newtypestbl where v<="world" sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where v="bee   ";
@@ -46,10 +46,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where v in ("bee", "orange");
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where v in ("bee", "world");
+select * from newtypestbl where v in ("bee", "world") sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where v in ("bee", "world");
+select * from newtypestbl where v in ("bee", "world") sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where v in ("orange");
@@ -64,10 +64,10 @@ set hive.optimize.index.filter=true;
 select * from newtypestbl where v between "bee" and "orange";
 
 set hive.optimize.index.filter=false;
-select * from newtypestbl where v between "bee" and "zombie";
+select * from newtypestbl where v between "bee" and "zombie" sort by c;
 
 set hive.optimize.index.filter=true;
-select * from newtypestbl where v between "bee" and "zombie";
+select * from newtypestbl where v between "bee" and "zombie" sort by c;
 
 set hive.optimize.index.filter=false;
 select * from newtypestbl where v between "orange" and "pine";

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_boolean.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_boolean.q.out b/ql/src/test/results/clientpositive/parquet_ppd_boolean.q.out
index 51ea879..1355849 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_boolean.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_boolean.q.out
@@ -65,24 +65,24 @@ POSTHOOK: query: select * from newtypestbl where b>true
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-PREHOOK: query: select * from newtypestbl where b<=true
+PREHOOK: query: select * from newtypestbl where b<=true sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where b<=true
+POSTHOOK: query: select * from newtypestbl where b<=true sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
 PREHOOK: query: select * from newtypestbl where b=false
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -190,24 +190,24 @@ POSTHOOK: query: select * from newtypestbl where b>true
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-PREHOOK: query: select * from newtypestbl where b<=true
+PREHOOK: query: select * from newtypestbl where b<=true sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where b<=true
+POSTHOOK: query: select * from newtypestbl where b<=true sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
-hello     	world	11.22	false
 apple     	bee	0.22	true
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
+hello     	world	11.22	false
 PREHOOK: query: select * from newtypestbl where b=false
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_char.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_char.q.out b/ql/src/test/results/clientpositive/parquet_ppd_char.q.out
index af4a13c..f224870 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_char.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_char.q.out
@@ -98,42 +98,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c<="hello"
+PREHOOK: query: select * from newtypestbl where c<="hello" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c<="hello"
+POSTHOOK: query: select * from newtypestbl where c<="hello" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c<="hello"
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where c<="hello" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c<="hello"
+POSTHOOK: query: select * from newtypestbl where c<="hello" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where c="apple "
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -176,42 +176,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c in ("apple", "hello")
+PREHOOK: query: select * from newtypestbl where c in ("apple", "hello") sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c in ("apple", "hello")
+POSTHOOK: query: select * from newtypestbl where c in ("apple", "hello") sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c in ("apple", "hello")
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where c in ("apple", "hello") sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c in ("apple", "hello")
+POSTHOOK: query: select * from newtypestbl where c in ("apple", "hello") sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where c in ("carrot")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -254,42 +254,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c between "apple" and "zombie"
+PREHOOK: query: select * from newtypestbl where c between "apple" and "zombie" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c between "apple" and "zombie"
+POSTHOOK: query: select * from newtypestbl where c between "apple" and "zombie" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where c between "apple" and "zombie"
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where c between "apple" and "zombie" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where c between "apple" and "zombie"
+POSTHOOK: query: select * from newtypestbl where c between "apple" and "zombie" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where c between "carrot" and "carrot1"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_date.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_date.q.out b/ql/src/test/results/clientpositive/parquet_ppd_date.q.out
index 60c9a59..e599014 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_date.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_date.q.out
@@ -163,42 +163,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da<'1970-02-29'
+PREHOOK: query: select * from newtypestbl where da<'1970-02-29' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da<'1970-02-29'
+POSTHOOK: query: select * from newtypestbl where da<'1970-02-29' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da<'1970-02-29'
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where da<'1970-02-29' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da<'1970-02-29'
+POSTHOOK: query: select * from newtypestbl where da<'1970-02-29' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where da<'1970-02-15'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -241,42 +241,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da<='1970-02-27'
+PREHOOK: query: select * from newtypestbl where da<='1970-02-27' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da<='1970-02-27'
+POSTHOOK: query: select * from newtypestbl where da<='1970-02-27' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da<='1970-02-27'
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where da<='1970-02-27' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da<='1970-02-27'
+POSTHOOK: query: select * from newtypestbl where da<='1970-02-27' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-21' as date), cast('1970-02-27' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -303,42 +303,42 @@ hello     	world	11.22	1970-02-27
 hello     	world	11.22	1970-02-27
 hello     	world	11.22	1970-02-27
 hello     	world	11.22	1970-02-27
-PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
+PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
+POSTHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
+POSTHOOK: query: select * from newtypestbl where da in (cast('1970-02-20' as date), cast('1970-02-27' as date)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where da in (cast('1970-02-21' as date), cast('1970-02-22' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -381,42 +381,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28'
+PREHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28'
+POSTHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28'
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28'
+POSTHOOK: query: select * from newtypestbl where da between '1970-02-19' and '1970-02-28' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where da between '1970-02-18' and '1970-02-19'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_decimal.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_decimal.q.out b/ql/src/test/results/clientpositive/parquet_ppd_decimal.q.out
index ec603eb..7c17733 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_decimal.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_decimal.q.out
@@ -280,114 +280,114 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=11.22
+PREHOOK: query: select * from newtypestbl where d<=11.22 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=11.22
+POSTHOOK: query: select * from newtypestbl where d<=11.22 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=11.22
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=11.22 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=11.22
+POSTHOOK: query: select * from newtypestbl where d<=11.22 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<='11.22'
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<='11.22' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<='11.22'
+POSTHOOK: query: select * from newtypestbl where d<='11.22' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<='11.22'
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<='11.22' sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<='11.22'
+POSTHOOK: query: select * from newtypestbl where d<='11.22' sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=cast('11.22' as float)
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=cast('11.22' as float) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=cast('11.22' as float)
+POSTHOOK: query: select * from newtypestbl where d<=cast('11.22' as float) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=cast('11.22' as float)
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=cast('11.22' as float) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=cast('11.22' as float)
+POSTHOOK: query: select * from newtypestbl where d<=cast('11.22' as float) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where d<=cast('11.22' as decimal)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -414,78 +414,78 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=11.22BD
+PREHOOK: query: select * from newtypestbl where d<=11.22BD sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=11.22BD
+POSTHOOK: query: select * from newtypestbl where d<=11.22BD sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=11.22BD
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=11.22BD sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=11.22BD
+POSTHOOK: query: select * from newtypestbl where d<=11.22BD sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=12
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=12 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=12
+POSTHOOK: query: select * from newtypestbl where d<=12 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d<=12
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d<=12 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d<=12
+POSTHOOK: query: select * from newtypestbl where d<=12 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where d in ('0.22', '1.0')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -512,42 +512,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d in ('0.22', '11.22')
+PREHOOK: query: select * from newtypestbl where d in ('0.22', '11.22') sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d in ('0.22', '11.22')
+POSTHOOK: query: select * from newtypestbl where d in ('0.22', '11.22') sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d in ('0.22', '11.22')
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d in ('0.22', '11.22') sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d in ('0.22', '11.22')
+POSTHOOK: query: select * from newtypestbl where d in ('0.22', '11.22') sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where d in ('0.9', '1.0')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -590,42 +590,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float))
+PREHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float))
+POSTHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float))
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float))
+POSTHOOK: query: select * from newtypestbl where d in ('0.9', 0.22, cast('11.22' as float)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where d between 0 and 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -652,42 +652,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d between 0 and 1000
+PREHOOK: query: select * from newtypestbl where d between 0 and 1000 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d between 0 and 1000
+POSTHOOK: query: select * from newtypestbl where d between 0 and 1000 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where d between 0 and 1000
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where d between 0 and 1000 sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where d between 0 and 1000
+POSTHOOK: query: select * from newtypestbl where d between 0 and 1000 sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where d between 0 and '2.0'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_timestamp.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_timestamp.q.out b/ql/src/test/results/clientpositive/parquet_ppd_timestamp.q.out
index 3693879..e314c10 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_timestamp.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_timestamp.q.out
@@ -150,42 +150,42 @@ apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp)
+PREHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp)
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+PREHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts<cast('2011-01-22 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
 PREHOOK: query: select * from newtypestbl where ts<cast('2010-10-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -228,42 +228,42 @@ apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp)
+PREHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp)
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+PREHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts<=cast('2011-01-20 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
 PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -290,42 +290,42 @@ hello     	world	11.22	2011-01-20 01:01:01
 hello     	world	11.22	2011-01-20 01:01:01
 hello     	world	11.22	2011-01-20 01:01:01
 hello     	world	11.22	2011-01-20 01:01:01
-PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
+PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
+POSTHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
+POSTHOOK: query: select * from newtypestbl where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp)) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
 PREHOOK: query: select * from newtypestbl where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-08 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -368,42 +368,42 @@ apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
+PREHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-PREHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+PREHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
+POSTHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp) sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
-hello     	world	11.22	2011-01-20 01:01:01
 apple     	bee	0.22	2011-01-01 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
+hello     	world	11.22	2011-01-20 01:01:01
 PREHOOK: query: select * from newtypestbl where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2010-11-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl

http://git-wip-us.apache.org/repos/asf/hive/blob/92b42ae9/ql/src/test/results/clientpositive/parquet_ppd_varchar.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_ppd_varchar.q.out b/ql/src/test/results/clientpositive/parquet_ppd_varchar.q.out
index 0574e5d..2e9f72f 100644
--- a/ql/src/test/results/clientpositive/parquet_ppd_varchar.q.out
+++ b/ql/src/test/results/clientpositive/parquet_ppd_varchar.q.out
@@ -98,42 +98,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v<="world"
+PREHOOK: query: select * from newtypestbl where v<="world" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v<="world"
+POSTHOOK: query: select * from newtypestbl where v<="world" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v<="world"
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where v<="world" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v<="world"
+POSTHOOK: query: select * from newtypestbl where v<="world" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where v="bee   "
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -176,42 +176,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v in ("bee", "world")
+PREHOOK: query: select * from newtypestbl where v in ("bee", "world") sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v in ("bee", "world")
+POSTHOOK: query: select * from newtypestbl where v in ("bee", "world") sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v in ("bee", "world")
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where v in ("bee", "world") sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v in ("bee", "world")
+POSTHOOK: query: select * from newtypestbl where v in ("bee", "world") sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where v in ("orange")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
@@ -254,42 +254,42 @@ apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v between "bee" and "zombie"
+PREHOOK: query: select * from newtypestbl where v between "bee" and "zombie" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v between "bee" and "zombie"
+POSTHOOK: query: select * from newtypestbl where v between "bee" and "zombie" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-PREHOOK: query: select * from newtypestbl where v between "bee" and "zombie"
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+PREHOOK: query: select * from newtypestbl where v between "bee" and "zombie" sort by c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-POSTHOOK: query: select * from newtypestbl where v between "bee" and "zombie"
+POSTHOOK: query: select * from newtypestbl where v between "bee" and "zombie" sort by c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypestbl
 #### A masked pattern was here ####
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
-hello     	world	11.22	1970-02-27
 apple     	bee	0.22	1970-02-20
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
+hello     	world	11.22	1970-02-27
 PREHOOK: query: select * from newtypestbl where v between "orange" and "pine"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypestbl