hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aihu...@apache.org
Subject [2/2] hive git commit: HIVE-15298: Unit test failures in TestCliDriver sample[2, 4, 6, 7, 9] (Barna Zsombor Klara via Aihua Xu, reviewed by Jason Dere)
Date Tue, 20 Dec 2016 14:24:45 GMT
HIVE-15298: Unit test failures in TestCliDriver sample[2,4,6,7,9] (Barna Zsombor Klara via Aihua Xu, reviewed by Jason Dere)


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

Branch: refs/heads/master
Commit: 530f2b0d2b7ae5364fdc01c26394f6b876256057
Parents: eb26dff
Author: Aihua Xu <aihuaxu@apache.org>
Authored: Tue Dec 20 09:24:00 2016 -0500
Committer: Aihua Xu <aihuaxu@apache.org>
Committed: Tue Dec 20 09:24:00 2016 -0500

----------------------------------------------------------------------
 ql/src/test/queries/clientpositive/sample2.q    |   3 +-
 ql/src/test/queries/clientpositive/sample4.q    |   3 +-
 ql/src/test/queries/clientpositive/sample6.q    |   3 +-
 ql/src/test/queries/clientpositive/sample7.q    |   3 +-
 ql/src/test/queries/clientpositive/sample9.q    |   3 +-
 .../test/results/clientpositive/sample2.q.out   | 906 ++++++++++---------
 .../test/results/clientpositive/sample4.q.out   | 906 ++++++++++---------
 .../test/results/clientpositive/sample6.q.out   | 436 ++++-----
 .../test/results/clientpositive/sample7.q.out   | 340 +++----
 .../test/results/clientpositive/sample9.q.out   | 906 ++++++++++---------
 .../results/clientpositive/spark/sample2.q.out  | 902 +++++++++---------
 .../results/clientpositive/spark/sample4.q.out  | 902 +++++++++---------
 .../results/clientpositive/spark/sample6.q.out  | 438 ++++-----
 .../results/clientpositive/spark/sample7.q.out  | 344 +++----
 .../results/clientpositive/spark/sample9.q.out  | 902 +++++++++---------
 15 files changed, 3511 insertions(+), 3486 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/queries/clientpositive/sample2.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/sample2.q b/ql/src/test/queries/clientpositive/sample2.q
index 9ca5d26..119afc9 100644
--- a/ql/src/test/queries/clientpositive/sample2.q
+++ b/ql/src/test/queries/clientpositive/sample2.q
@@ -9,4 +9,5 @@ FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2) s;
 INSERT OVERWRITE TABLE dest1 SELECT s.* 
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2) s;
 
-SELECT dest1.* FROM dest1;
+SELECT dest1.* FROM dest1
+order by key, value;

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/queries/clientpositive/sample4.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/sample4.q b/ql/src/test/queries/clientpositive/sample4.q
index 85a9d92..0fa55f7 100644
--- a/ql/src/test/queries/clientpositive/sample4.q
+++ b/ql/src/test/queries/clientpositive/sample4.q
@@ -9,4 +9,5 @@ FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) s;
 INSERT OVERWRITE TABLE dest1 SELECT s.*
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) s;
 
-SELECT dest1.* FROM dest1;
+SELECT dest1.* FROM dest1
+order by key, value;

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/queries/clientpositive/sample6.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/sample6.q b/ql/src/test/queries/clientpositive/sample6.q
index 8f9a463..0e094b1 100644
--- a/ql/src/test/queries/clientpositive/sample6.q
+++ b/ql/src/test/queries/clientpositive/sample6.q
@@ -9,7 +9,8 @@ FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 4 on key) s;
 INSERT OVERWRITE TABLE dest1 SELECT s.*
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 4 on key) s;
 
-SELECT dest1.* FROM dest1;
+SELECT dest1.* FROM dest1
+order by key, value;
 
 EXPLAIN EXTENDED SELECT s.* FROM srcbucket TABLESAMPLE (BUCKET 4 OUT OF 4 on key) s
 ORDER BY key, value;

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/queries/clientpositive/sample7.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/sample7.q b/ql/src/test/queries/clientpositive/sample7.q
index 18344d7..20584aa 100644
--- a/ql/src/test/queries/clientpositive/sample7.q
+++ b/ql/src/test/queries/clientpositive/sample7.q
@@ -10,4 +10,5 @@ INSERT OVERWRITE TABLE dest1 SELECT s.*
 FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 4 on key) s
 WHERE s.key > 100;
 
-SELECT dest1.* FROM dest1;
+SELECT dest1.* FROM dest1
+order by key, value;

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/queries/clientpositive/sample9.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/sample9.q b/ql/src/test/queries/clientpositive/sample9.q
index 03139ca..13cc04f 100644
--- a/ql/src/test/queries/clientpositive/sample9.q
+++ b/ql/src/test/queries/clientpositive/sample9.q
@@ -3,4 +3,5 @@ SELECT s.*
 FROM (SELECT a.* FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) a) s;
 
 SELECT s.*
-FROM (SELECT a.* FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) a) s;
+FROM (SELECT a.* FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) a) s
+order by key, value;

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/sample2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample2.q.out b/ql/src/test/results/clientpositive/sample2.q.out
index 06690df..f4917f0 100644
--- a/ql/src/test/results/clientpositive/sample2.q.out
+++ b/ql/src/test/results/clientpositive/sample2.q.out
@@ -355,503 +355,505 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-490	val_491
-356	val_357
-106	val_107
-126	val_127
-428	val_429
-296	val_297
-278	val_279
-440	val_441
-246	val_247
-448	val_449
-272	val_273
-468	val_469
-62	val_63
-474	val_475
-200	val_200
-400	val_400
-90	val_90
-126	val_126
-222	val_222
-414	val_414
-194	val_194
-348	val_348
-152	val_152
-448	val_448
-28	val_28
-84	val_84
-344	val_344
+0	val_0
+0	val_0
+0	val_0
+0	val_1
+0	val_1
+2	val_2
+2	val_3
+4	val_4
+4	val_5
+6	val_7
+6	val_7
+8	val_8
+8	val_9
+10	val_10
+10	val_11
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
 18	val_18
-348	val_348
-186	val_186
-362	val_362
-458	val_458
-146	val_146
-498	val_498
-298	val_298
-100	val_100
-492	val_492
-462	val_462
 18	val_18
-384	val_384
-134	val_134
+20	val_20
+20	val_21
+20	val_21
+22	val_23
+24	val_24
+24	val_24
 26	val_26
-256	val_256
-384	val_384
-454	val_454
-406	val_406
-462	val_462
-214	val_214
-172	val_172
-136	val_136
-480	val_480
-460	val_460
-310	val_310
-468	val_468
-178	val_178
-478	val_478
-230	val_230
-120	val_120
-444	val_444
-248	val_248
-360	val_360
-200	val_200
-414	val_414
-438	val_438
+26	val_26
+28	val_28
+30	val_30
+30	val_31
+32	val_33
+34	val_34
+40	val_41
+40	val_41
+42	val_42
+42	val_42
+42	val_43
+42	val_43
+42	val_43
+44	val_44
+46	val_47
+48	val_49
+48	val_49
+50	val_51
+52	val_53
+52	val_53
+52	val_53
+52	val_53
+54	val_54
+56	val_57
+58	val_58
+58	val_58
+58	val_59
+58	val_59
+60	val_61
+62	val_63
+62	val_63
+64	val_64
+66	val_66
+68	val_69
 70	val_70
-104	val_104
-24	val_24
-480	val_480
 70	val_70
-382	val_382
-424	val_424
-164	val_164
-298	val_298
-478	val_478
-454	val_454
-164	val_164
-396	val_396
-12	val_12
-424	val_424
-348	val_348
-262	val_262
-90	val_90
-258	val_258
-114	val_114
-406	val_406
-190	val_190
-406	val_406
-366	val_366
-466	val_466
-104	val_104
-44	val_44
-80	val_80
-2	val_2
-280	val_280
-316	val_316
-202	val_202
-432	val_432
-128	val_128
-438	val_438
-244	val_244
-288	val_288
-480	val_480
 70	val_70
-256	val_256
-116	val_116
-274	val_274
-344	val_344
-216	val_216
-296	val_296
-368	val_368
-230	val_230
-342	val_342
+70	val_71
+72	val_72
+72	val_72
 74	val_74
 76	val_76
-468	val_468
-64	val_64
-30	val_30
-138	val_138
-228	val_228
-218	val_218
-492	val_492
 76	val_76
+76	val_77
+76	val_77
+76	val_77
 78	val_78
-458	val_458
-430	val_430
-42	val_42
-160	val_160
-498	val_498
-322	val_322
-472	val_472
-34	val_34
-168	val_168
-336	val_336
-58	val_58
-396	val_396
-402	val_402
-226	val_226
-452	val_452
-242	val_242
-272	val_272
-392	val_392
-242	val_242
-224	val_224
-306	val_306
-10	val_10
+78	val_79
+80	val_80
+80	val_81
+82	val_82
+82	val_83
+82	val_83
+84	val_84
+84	val_84
+86	val_86
+86	val_87
 90	val_90
-72	val_72
-118	val_118
-238	val_238
-138	val_138
-282	val_282
-134	val_134
-118	val_118
-364	val_364
-490	val_490
-0	val_0
-316	val_316
-470	val_470
-318	val_318
-318	val_318
-282	val_282
-98	val_98
-288	val_288
-196	val_196
-308	val_308
-468	val_468
-156	val_156
-436	val_436
-404	val_404
-120	val_120
-230	val_230
-26	val_26
+90	val_90
+90	val_90
+92	val_92
+94	val_95
 96	val_96
-418	val_418
-298	val_298
+98	val_98
+98	val_98
 100	val_100
-454	val_454
-468	val_468
-322	val_322
-0	val_0
-496	val_496
-158	val_158
-42	val_42
-172	val_172
-24	val_24
-348	val_348
-208	val_208
-230	val_230
-8	val_8
-58	val_58
-466	val_466
-348	val_348
-84	val_84
+100	val_100
+100	val_101
+100	val_101
+102	val_103
+104	val_104
+104	val_104
+104	val_105
+104	val_105
+104	val_105
+106	val_107
+110	val_111
+114	val_114
+114	val_115
+114	val_115
+114	val_115
+116	val_116
+116	val_117
+118	val_118
+118	val_118
+118	val_119
+118	val_119
+118	val_119
+120	val_120
+120	val_120
+120	val_121
+122	val_123
+122	val_123
+122	val_123
+126	val_126
+126	val_127
+126	val_127
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+134	val_134
+134	val_134
+134	val_135
+136	val_136
+136	val_137
 138	val_138
-272	val_272
-384	val_384
-404	val_404
-260	val_260
-230	val_230
-12	val_12
-284	val_284
-180	val_180
-332	val_332
-318	val_318
-176	val_176
-278	val_278
-430	val_430
-216	val_216
 138	val_138
-54	val_54
+138	val_138
+138	val_138
+138	val_139
+138	val_139
+140	val_141
+144	val_145
+146	val_146
+146	val_146
+150	val_150
+152	val_152
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
+158	val_158
+160	val_160
+160	val_161
+162	val_162
+162	val_163
+164	val_164
+164	val_164
+164	val_165
+164	val_165
+166	val_166
+168	val_168
+168	val_169
+170	val_170
+170	val_171
+172	val_172
+172	val_172
+172	val_173
+174	val_174
+174	val_174
+174	val_175
+174	val_175
 176	val_176
-286	val_286
+176	val_176
+178	val_178
+178	val_179
+178	val_179
+180	val_180
+182	val_183
+184	val_185
+186	val_186
+190	val_190
 192	val_192
-386	val_386
-498	val_498
-382	val_382
-356	val_356
+192	val_193
+194	val_194
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+202	val_202
+204	val_205
+206	val_207
+206	val_207
+206	val_207
 208	val_208
-280	val_280
-4	val_4
-72	val_72
-92	val_92
-378	val_378
-20	val_20
-170	val_170
-438	val_438
-302	val_302
-316	val_316
-128	val_128
-0	val_0
-342	val_342
-266	val_266
-162	val_162
-396	val_396
-174	val_174
 208	val_208
-466	val_466
-494	val_494
-174	val_174
-482	val_482
-394	val_394
-446	val_446
-338	val_338
-292	val_292
-252	val_252
-430	val_430
-166	val_166
-82	val_82
-152	val_152
-374	val_374
-406	val_406
-146	val_146
-128	val_128
-66	val_66
+208	val_208
+212	val_213
+214	val_214
+216	val_216
+216	val_216
+216	val_217
+218	val_218
+222	val_222
+222	val_223
 224	val_224
-150	val_150
-484	val_484
-98	val_98
-278	val_278
-86	val_86
+224	val_224
+224	val_225
+226	val_226
+226	val_227
+226	val_227
+226	val_227
+226	val_227
+228	val_228
+228	val_229
+230	val_230
+230	val_230
+230	val_230
+230	val_230
+230	val_230
 238	val_238
-244	val_245
+238	val_238
+238	val_239
+240	val_241
+242	val_242
+242	val_242
 242	val_243
-178	val_179
-118	val_119
-478	val_479
-300	val_301
-76	val_77
-138	val_139
-152	val_153
-468	val_469
-430	val_431
-308	val_309
-100	val_101
-440	val_441
-82	val_83
-410	val_411
-196	val_197
-134	val_135
-78	val_79
-46	val_47
-276	val_277
+244	val_244
 244	val_245
-162	val_163
-62	val_63
-402	val_403
+244	val_245
+244	val_245
+246	val_247
+246	val_247
+248	val_248
 248	val_249
-22	val_23
-228	val_229
-156	val_157
-100	val_101
-178	val_179
-478	val_479
-40	val_41
-412	val_413
-292	val_293
+252	val_252
+252	val_253
+254	val_255
+256	val_256
+256	val_256
 256	val_257
-414	val_415
-378	val_379
-152	val_153
-486	val_487
-52	val_53
-310	val_311
-474	val_475
-182	val_183
+258	val_258
+258	val_259
+260	val_260
+260	val_261
+260	val_261
+262	val_262
+262	val_263
+262	val_263
+264	val_265
+264	val_265
+266	val_266
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+274	val_274
+274	val_275
+276	val_277
+278	val_278
+278	val_278
+278	val_279
+280	val_280
+280	val_280
+282	val_282
+282	val_282
+284	val_284
+284	val_285
+284	val_285
+286	val_286
+286	val_287
+288	val_288
+288	val_288
+292	val_292
 292	val_293
-122	val_123
+292	val_293
+296	val_296
+296	val_297
+298	val_298
+298	val_298
+298	val_298
+300	val_301
+300	val_301
+302	val_302
+302	val_303
+304	val_305
+306	val_306
+306	val_307
+308	val_308
+308	val_309
+308	val_309
+310	val_310
+310	val_311
+310	val_311
+310	val_311
+314	val_315
+316	val_316
+316	val_316
+316	val_316
+318	val_318
+318	val_318
+318	val_318
+318	val_319
+322	val_322
+322	val_322
+322	val_323
+324	val_325
+326	val_327
+328	val_329
+328	val_329
+330	val_331
+332	val_332
+334	val_335
+336	val_336
+336	val_337
+338	val_338
+338	val_339
+340	val_341
+342	val_342
+342	val_342
+342	val_343
+344	val_344
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
 348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+358	val_359
+360	val_360
+360	val_361
+362	val_362
+364	val_364
+364	val_365
+366	val_366
+368	val_368
+374	val_374
+374	val_375
+376	val_377
+378	val_378
+378	val_379
+382	val_382
+382	val_382
 382	val_383
-152	val_153
+382	val_383
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+386	val_386
+386	val_387
+386	val_387
+388	val_389
+390	val_391
+390	val_391
+390	val_391
+392	val_392
+392	val_393
+392	val_393
+394	val_394
+396	val_396
+396	val_396
+396	val_396
+398	val_399
+400	val_400
+402	val_402
+402	val_403
+402	val_403
+402	val_403
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
+406	val_406
+406	val_406
+406	val_406
+406	val_406
+406	val_407
 408	val_409
-144	val_145
-496	val_497
+408	val_409
+410	val_411
+412	val_413
+412	val_413
+414	val_414
+414	val_414
+414	val_415
+416	val_417
+418	val_418
+424	val_424
+424	val_424
+424	val_425
+426	val_427
+428	val_429
+430	val_430
+430	val_430
+430	val_430
+430	val_431
+432	val_432
 432	val_433
-462	val_463
-136	val_137
-164	val_165
-284	val_285
-6	val_7
-244	val_245
-172	val_173
-118	val_119
-156	val_157
+436	val_436
 436	val_437
-104	val_105
-392	val_393
-268	val_269
-0	val_1
-300	val_301
-446	val_447
-404	val_405
-52	val_53
+438	val_438
+438	val_438
+438	val_438
+438	val_439
+438	val_439
+440	val_441
+440	val_441
 442	val_443
-60	val_61
-384	val_385
-334	val_335
-398	val_399
-12	val_13
+444	val_444
+446	val_446
+446	val_447
+446	val_447
+448	val_448
+448	val_449
 450	val_451
-302	val_303
-196	val_197
-470	val_471
-216	val_217
-494	val_495
-374	val_375
-274	val_275
-126	val_127
-204	val_205
-16	val_17
-412	val_413
-174	val_175
-76	val_77
+450	val_451
+452	val_452
+454	val_454
+454	val_454
+454	val_454
 454	val_455
-160	val_161
-138	val_139
-330	val_331
-52	val_53
-352	val_353
-356	val_357
-70	val_71
-58	val_59
-192	val_193
-132	val_133
-32	val_33
-406	val_407
-104	val_105
-42	val_43
-116	val_117
-76	val_77
-384	val_385
-404	val_405
-122	val_123
-322	val_323
-328	val_329
-260	val_261
-262	val_263
-226	val_227
-206	val_207
-404	val_405
-206	val_207
-310	val_311
-324	val_325
-384	val_385
-168	val_169
-8	val_9
-40	val_41
-52	val_53
-20	val_21
-364	val_365
 454	val_455
-386	val_387
-42	val_43
-416	val_417
-358	val_359
-30	val_31
-308	val_309
-212	val_213
-140	val_141
-450	val_451
-326	val_327
-80	val_81
-104	val_105
-310	val_311
-118	val_119
-164	val_165
-170	val_171
-2	val_3
-260	val_261
-6	val_7
-484	val_485
-390	val_391
-340	val_341
-336	val_337
-48	val_49
-264	val_265
-114	val_115
-252	val_253
-174	val_175
-258	val_259
+458	val_458
+458	val_458
+460	val_460
+462	val_462
+462	val_462
+462	val_463
+466	val_466
+466	val_466
+466	val_466
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+470	val_470
+470	val_471
+472	val_472
+474	val_475
+474	val_475
 476	val_477
-392	val_393
-318	val_319
+476	val_477
+478	val_478
+478	val_478
+478	val_479
+478	val_479
+480	val_480
+480	val_480
+480	val_480
 480	val_481
-102	val_103
 480	val_481
-342	val_343
-382	val_383
-328	val_329
-226	val_227
-352	val_353
-390	val_391
-438	val_439
-122	val_123
-262	val_263
-246	val_247
-284	val_285
-184	val_185
-388	val_389
-386	val_387
-446	val_447
-132	val_133
-426	val_427
-306	val_307
-120	val_121
-376	val_377
+482	val_482
+482	val_483
+484	val_484
+484	val_485
+486	val_487
+488	val_489
+490	val_490
+490	val_491
+492	val_492
+492	val_492
 492	val_493
-16	val_17
-68	val_69
-338	val_339
-42	val_43
-222	val_223
-360	val_361
-438	val_439
-86	val_87
-58	val_59
-82	val_83
 492	val_493
-20	val_21
-238	val_239
-196	val_197
-264	val_265
-304	val_305
-390	val_391
-254	val_255
-114	val_115
-56	val_57
-114	val_115
-206	val_207
-4	val_5
-344	val_345
-224	val_225
-314	val_315
-468	val_469
-128	val_129
-402	val_403
-50	val_51
-94	val_95
-488	val_489
+494	val_494
 494	val_495
-226	val_227
-424	val_425
-48	val_49
-482	val_483
-476	val_477
-408	val_409
-286	val_287
-240	val_241
-0	val_1
-110	val_111
-226	val_227
-10	val_11
-128	val_129
-402	val_403
+494	val_495
+496	val_496
+496	val_497
+498	val_498
+498	val_498
+498	val_498

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/sample4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample4.q.out b/ql/src/test/results/clientpositive/sample4.q.out
index 4652dd8..b15da6d 100644
--- a/ql/src/test/results/clientpositive/sample4.q.out
+++ b/ql/src/test/results/clientpositive/sample4.q.out
@@ -355,503 +355,505 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-490	val_491
-356	val_357
-106	val_107
-126	val_127
-428	val_429
-296	val_297
-278	val_279
-440	val_441
-246	val_247
-448	val_449
-272	val_273
-468	val_469
-62	val_63
-474	val_475
-200	val_200
-400	val_400
-90	val_90
-126	val_126
-222	val_222
-414	val_414
-194	val_194
-348	val_348
-152	val_152
-448	val_448
-28	val_28
-84	val_84
-344	val_344
+0	val_0
+0	val_0
+0	val_0
+0	val_1
+0	val_1
+2	val_2
+2	val_3
+4	val_4
+4	val_5
+6	val_7
+6	val_7
+8	val_8
+8	val_9
+10	val_10
+10	val_11
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
 18	val_18
-348	val_348
-186	val_186
-362	val_362
-458	val_458
-146	val_146
-498	val_498
-298	val_298
-100	val_100
-492	val_492
-462	val_462
 18	val_18
-384	val_384
-134	val_134
+20	val_20
+20	val_21
+20	val_21
+22	val_23
+24	val_24
+24	val_24
 26	val_26
-256	val_256
-384	val_384
-454	val_454
-406	val_406
-462	val_462
-214	val_214
-172	val_172
-136	val_136
-480	val_480
-460	val_460
-310	val_310
-468	val_468
-178	val_178
-478	val_478
-230	val_230
-120	val_120
-444	val_444
-248	val_248
-360	val_360
-200	val_200
-414	val_414
-438	val_438
+26	val_26
+28	val_28
+30	val_30
+30	val_31
+32	val_33
+34	val_34
+40	val_41
+40	val_41
+42	val_42
+42	val_42
+42	val_43
+42	val_43
+42	val_43
+44	val_44
+46	val_47
+48	val_49
+48	val_49
+50	val_51
+52	val_53
+52	val_53
+52	val_53
+52	val_53
+54	val_54
+56	val_57
+58	val_58
+58	val_58
+58	val_59
+58	val_59
+60	val_61
+62	val_63
+62	val_63
+64	val_64
+66	val_66
+68	val_69
 70	val_70
-104	val_104
-24	val_24
-480	val_480
 70	val_70
-382	val_382
-424	val_424
-164	val_164
-298	val_298
-478	val_478
-454	val_454
-164	val_164
-396	val_396
-12	val_12
-424	val_424
-348	val_348
-262	val_262
-90	val_90
-258	val_258
-114	val_114
-406	val_406
-190	val_190
-406	val_406
-366	val_366
-466	val_466
-104	val_104
-44	val_44
-80	val_80
-2	val_2
-280	val_280
-316	val_316
-202	val_202
-432	val_432
-128	val_128
-438	val_438
-244	val_244
-288	val_288
-480	val_480
 70	val_70
-256	val_256
-116	val_116
-274	val_274
-344	val_344
-216	val_216
-296	val_296
-368	val_368
-230	val_230
-342	val_342
+70	val_71
+72	val_72
+72	val_72
 74	val_74
 76	val_76
-468	val_468
-64	val_64
-30	val_30
-138	val_138
-228	val_228
-218	val_218
-492	val_492
 76	val_76
+76	val_77
+76	val_77
+76	val_77
 78	val_78
-458	val_458
-430	val_430
-42	val_42
-160	val_160
-498	val_498
-322	val_322
-472	val_472
-34	val_34
-168	val_168
-336	val_336
-58	val_58
-396	val_396
-402	val_402
-226	val_226
-452	val_452
-242	val_242
-272	val_272
-392	val_392
-242	val_242
-224	val_224
-306	val_306
-10	val_10
+78	val_79
+80	val_80
+80	val_81
+82	val_82
+82	val_83
+82	val_83
+84	val_84
+84	val_84
+86	val_86
+86	val_87
 90	val_90
-72	val_72
-118	val_118
-238	val_238
-138	val_138
-282	val_282
-134	val_134
-118	val_118
-364	val_364
-490	val_490
-0	val_0
-316	val_316
-470	val_470
-318	val_318
-318	val_318
-282	val_282
-98	val_98
-288	val_288
-196	val_196
-308	val_308
-468	val_468
-156	val_156
-436	val_436
-404	val_404
-120	val_120
-230	val_230
-26	val_26
+90	val_90
+90	val_90
+92	val_92
+94	val_95
 96	val_96
-418	val_418
-298	val_298
+98	val_98
+98	val_98
 100	val_100
-454	val_454
-468	val_468
-322	val_322
-0	val_0
-496	val_496
-158	val_158
-42	val_42
-172	val_172
-24	val_24
-348	val_348
-208	val_208
-230	val_230
-8	val_8
-58	val_58
-466	val_466
-348	val_348
-84	val_84
+100	val_100
+100	val_101
+100	val_101
+102	val_103
+104	val_104
+104	val_104
+104	val_105
+104	val_105
+104	val_105
+106	val_107
+110	val_111
+114	val_114
+114	val_115
+114	val_115
+114	val_115
+116	val_116
+116	val_117
+118	val_118
+118	val_118
+118	val_119
+118	val_119
+118	val_119
+120	val_120
+120	val_120
+120	val_121
+122	val_123
+122	val_123
+122	val_123
+126	val_126
+126	val_127
+126	val_127
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+134	val_134
+134	val_134
+134	val_135
+136	val_136
+136	val_137
 138	val_138
-272	val_272
-384	val_384
-404	val_404
-260	val_260
-230	val_230
-12	val_12
-284	val_284
-180	val_180
-332	val_332
-318	val_318
-176	val_176
-278	val_278
-430	val_430
-216	val_216
 138	val_138
-54	val_54
+138	val_138
+138	val_138
+138	val_139
+138	val_139
+140	val_141
+144	val_145
+146	val_146
+146	val_146
+150	val_150
+152	val_152
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
+158	val_158
+160	val_160
+160	val_161
+162	val_162
+162	val_163
+164	val_164
+164	val_164
+164	val_165
+164	val_165
+166	val_166
+168	val_168
+168	val_169
+170	val_170
+170	val_171
+172	val_172
+172	val_172
+172	val_173
+174	val_174
+174	val_174
+174	val_175
+174	val_175
 176	val_176
-286	val_286
+176	val_176
+178	val_178
+178	val_179
+178	val_179
+180	val_180
+182	val_183
+184	val_185
+186	val_186
+190	val_190
 192	val_192
-386	val_386
-498	val_498
-382	val_382
-356	val_356
+192	val_193
+194	val_194
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+202	val_202
+204	val_205
+206	val_207
+206	val_207
+206	val_207
 208	val_208
-280	val_280
-4	val_4
-72	val_72
-92	val_92
-378	val_378
-20	val_20
-170	val_170
-438	val_438
-302	val_302
-316	val_316
-128	val_128
-0	val_0
-342	val_342
-266	val_266
-162	val_162
-396	val_396
-174	val_174
 208	val_208
-466	val_466
-494	val_494
-174	val_174
-482	val_482
-394	val_394
-446	val_446
-338	val_338
-292	val_292
-252	val_252
-430	val_430
-166	val_166
-82	val_82
-152	val_152
-374	val_374
-406	val_406
-146	val_146
-128	val_128
-66	val_66
+208	val_208
+212	val_213
+214	val_214
+216	val_216
+216	val_216
+216	val_217
+218	val_218
+222	val_222
+222	val_223
 224	val_224
-150	val_150
-484	val_484
-98	val_98
-278	val_278
-86	val_86
+224	val_224
+224	val_225
+226	val_226
+226	val_227
+226	val_227
+226	val_227
+226	val_227
+228	val_228
+228	val_229
+230	val_230
+230	val_230
+230	val_230
+230	val_230
+230	val_230
 238	val_238
-244	val_245
+238	val_238
+238	val_239
+240	val_241
+242	val_242
+242	val_242
 242	val_243
-178	val_179
-118	val_119
-478	val_479
-300	val_301
-76	val_77
-138	val_139
-152	val_153
-468	val_469
-430	val_431
-308	val_309
-100	val_101
-440	val_441
-82	val_83
-410	val_411
-196	val_197
-134	val_135
-78	val_79
-46	val_47
-276	val_277
+244	val_244
 244	val_245
-162	val_163
-62	val_63
-402	val_403
+244	val_245
+244	val_245
+246	val_247
+246	val_247
+248	val_248
 248	val_249
-22	val_23
-228	val_229
-156	val_157
-100	val_101
-178	val_179
-478	val_479
-40	val_41
-412	val_413
-292	val_293
+252	val_252
+252	val_253
+254	val_255
+256	val_256
+256	val_256
 256	val_257
-414	val_415
-378	val_379
-152	val_153
-486	val_487
-52	val_53
-310	val_311
-474	val_475
-182	val_183
+258	val_258
+258	val_259
+260	val_260
+260	val_261
+260	val_261
+262	val_262
+262	val_263
+262	val_263
+264	val_265
+264	val_265
+266	val_266
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+274	val_274
+274	val_275
+276	val_277
+278	val_278
+278	val_278
+278	val_279
+280	val_280
+280	val_280
+282	val_282
+282	val_282
+284	val_284
+284	val_285
+284	val_285
+286	val_286
+286	val_287
+288	val_288
+288	val_288
+292	val_292
 292	val_293
-122	val_123
+292	val_293
+296	val_296
+296	val_297
+298	val_298
+298	val_298
+298	val_298
+300	val_301
+300	val_301
+302	val_302
+302	val_303
+304	val_305
+306	val_306
+306	val_307
+308	val_308
+308	val_309
+308	val_309
+310	val_310
+310	val_311
+310	val_311
+310	val_311
+314	val_315
+316	val_316
+316	val_316
+316	val_316
+318	val_318
+318	val_318
+318	val_318
+318	val_319
+322	val_322
+322	val_322
+322	val_323
+324	val_325
+326	val_327
+328	val_329
+328	val_329
+330	val_331
+332	val_332
+334	val_335
+336	val_336
+336	val_337
+338	val_338
+338	val_339
+340	val_341
+342	val_342
+342	val_342
+342	val_343
+344	val_344
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
 348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+358	val_359
+360	val_360
+360	val_361
+362	val_362
+364	val_364
+364	val_365
+366	val_366
+368	val_368
+374	val_374
+374	val_375
+376	val_377
+378	val_378
+378	val_379
+382	val_382
+382	val_382
 382	val_383
-152	val_153
+382	val_383
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+386	val_386
+386	val_387
+386	val_387
+388	val_389
+390	val_391
+390	val_391
+390	val_391
+392	val_392
+392	val_393
+392	val_393
+394	val_394
+396	val_396
+396	val_396
+396	val_396
+398	val_399
+400	val_400
+402	val_402
+402	val_403
+402	val_403
+402	val_403
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
+406	val_406
+406	val_406
+406	val_406
+406	val_406
+406	val_407
 408	val_409
-144	val_145
-496	val_497
+408	val_409
+410	val_411
+412	val_413
+412	val_413
+414	val_414
+414	val_414
+414	val_415
+416	val_417
+418	val_418
+424	val_424
+424	val_424
+424	val_425
+426	val_427
+428	val_429
+430	val_430
+430	val_430
+430	val_430
+430	val_431
+432	val_432
 432	val_433
-462	val_463
-136	val_137
-164	val_165
-284	val_285
-6	val_7
-244	val_245
-172	val_173
-118	val_119
-156	val_157
+436	val_436
 436	val_437
-104	val_105
-392	val_393
-268	val_269
-0	val_1
-300	val_301
-446	val_447
-404	val_405
-52	val_53
+438	val_438
+438	val_438
+438	val_438
+438	val_439
+438	val_439
+440	val_441
+440	val_441
 442	val_443
-60	val_61
-384	val_385
-334	val_335
-398	val_399
-12	val_13
+444	val_444
+446	val_446
+446	val_447
+446	val_447
+448	val_448
+448	val_449
 450	val_451
-302	val_303
-196	val_197
-470	val_471
-216	val_217
-494	val_495
-374	val_375
-274	val_275
-126	val_127
-204	val_205
-16	val_17
-412	val_413
-174	val_175
-76	val_77
+450	val_451
+452	val_452
+454	val_454
+454	val_454
+454	val_454
 454	val_455
-160	val_161
-138	val_139
-330	val_331
-52	val_53
-352	val_353
-356	val_357
-70	val_71
-58	val_59
-192	val_193
-132	val_133
-32	val_33
-406	val_407
-104	val_105
-42	val_43
-116	val_117
-76	val_77
-384	val_385
-404	val_405
-122	val_123
-322	val_323
-328	val_329
-260	val_261
-262	val_263
-226	val_227
-206	val_207
-404	val_405
-206	val_207
-310	val_311
-324	val_325
-384	val_385
-168	val_169
-8	val_9
-40	val_41
-52	val_53
-20	val_21
-364	val_365
 454	val_455
-386	val_387
-42	val_43
-416	val_417
-358	val_359
-30	val_31
-308	val_309
-212	val_213
-140	val_141
-450	val_451
-326	val_327
-80	val_81
-104	val_105
-310	val_311
-118	val_119
-164	val_165
-170	val_171
-2	val_3
-260	val_261
-6	val_7
-484	val_485
-390	val_391
-340	val_341
-336	val_337
-48	val_49
-264	val_265
-114	val_115
-252	val_253
-174	val_175
-258	val_259
+458	val_458
+458	val_458
+460	val_460
+462	val_462
+462	val_462
+462	val_463
+466	val_466
+466	val_466
+466	val_466
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+470	val_470
+470	val_471
+472	val_472
+474	val_475
+474	val_475
 476	val_477
-392	val_393
-318	val_319
+476	val_477
+478	val_478
+478	val_478
+478	val_479
+478	val_479
+480	val_480
+480	val_480
+480	val_480
 480	val_481
-102	val_103
 480	val_481
-342	val_343
-382	val_383
-328	val_329
-226	val_227
-352	val_353
-390	val_391
-438	val_439
-122	val_123
-262	val_263
-246	val_247
-284	val_285
-184	val_185
-388	val_389
-386	val_387
-446	val_447
-132	val_133
-426	val_427
-306	val_307
-120	val_121
-376	val_377
+482	val_482
+482	val_483
+484	val_484
+484	val_485
+486	val_487
+488	val_489
+490	val_490
+490	val_491
+492	val_492
+492	val_492
 492	val_493
-16	val_17
-68	val_69
-338	val_339
-42	val_43
-222	val_223
-360	val_361
-438	val_439
-86	val_87
-58	val_59
-82	val_83
 492	val_493
-20	val_21
-238	val_239
-196	val_197
-264	val_265
-304	val_305
-390	val_391
-254	val_255
-114	val_115
-56	val_57
-114	val_115
-206	val_207
-4	val_5
-344	val_345
-224	val_225
-314	val_315
-468	val_469
-128	val_129
-402	val_403
-50	val_51
-94	val_95
-488	val_489
+494	val_494
 494	val_495
-226	val_227
-424	val_425
-48	val_49
-482	val_483
-476	val_477
-408	val_409
-286	val_287
-240	val_241
-0	val_1
-110	val_111
-226	val_227
-10	val_11
-128	val_129
-402	val_403
+494	val_495
+496	val_496
+496	val_497
+498	val_498
+498	val_498
+498	val_498

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/sample6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample6.q.out b/ql/src/test/results/clientpositive/sample6.q.out
index 475fe02..089e954 100644
--- a/ql/src/test/results/clientpositive/sample6.q.out
+++ b/ql/src/test/results/clientpositive/sample6.q.out
@@ -353,262 +353,264 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-356	val_357
-428	val_429
-296	val_297
-440	val_441
-448	val_449
-272	val_273
-468	val_469
-200	val_200
-400	val_400
-348	val_348
-152	val_152
-448	val_448
+0	val_0
+0	val_0
+0	val_0
+0	val_1
+0	val_1
+4	val_4
+4	val_5
+8	val_8
+8	val_9
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
+20	val_20
+20	val_21
+20	val_21
+24	val_24
+24	val_24
 28	val_28
+32	val_33
+40	val_41
+40	val_41
+44	val_44
+48	val_49
+48	val_49
+52	val_53
+52	val_53
+52	val_53
+52	val_53
+56	val_57
+60	val_61
+64	val_64
+68	val_69
+72	val_72
+72	val_72
+76	val_76
+76	val_76
+76	val_77
+76	val_77
+76	val_77
+80	val_80
+80	val_81
 84	val_84
-344	val_344
-348	val_348
+84	val_84
+92	val_92
+96	val_96
 100	val_100
-492	val_492
-384	val_384
-256	val_256
-384	val_384
-172	val_172
-136	val_136
-480	val_480
-460	val_460
-468	val_468
-120	val_120
-444	val_444
-248	val_248
-360	val_360
-200	val_200
+100	val_100
+100	val_101
+100	val_101
 104	val_104
-24	val_24
-480	val_480
-424	val_424
-164	val_164
-164	val_164
-396	val_396
-12	val_12
-424	val_424
-348	val_348
 104	val_104
-44	val_44
-80	val_80
-280	val_280
-316	val_316
-432	val_432
-128	val_128
-244	val_244
-288	val_288
-480	val_480
-256	val_256
+104	val_105
+104	val_105
+104	val_105
 116	val_116
-344	val_344
-216	val_216
-296	val_296
-368	val_368
-76	val_76
-468	val_468
-64	val_64
-228	val_228
-492	val_492
-76	val_76
+116	val_117
+120	val_120
+120	val_120
+120	val_121
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+136	val_136
+136	val_137
+140	val_141
+144	val_145
+152	val_152
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
 160	val_160
-472	val_472
+160	val_161
+164	val_164
+164	val_164
+164	val_165
+164	val_165
 168	val_168
-336	val_336
-396	val_396
-452	val_452
-272	val_272
-392	val_392
-224	val_224
-72	val_72
-364	val_364
-0	val_0
-316	val_316
-288	val_288
-196	val_196
-308	val_308
-468	val_468
-156	val_156
-436	val_436
-404	val_404
-120	val_120
-96	val_96
-100	val_100
-468	val_468
-0	val_0
-496	val_496
+168	val_169
 172	val_172
-24	val_24
-348	val_348
-208	val_208
-8	val_8
-348	val_348
-84	val_84
-272	val_272
-384	val_384
-404	val_404
-260	val_260
-12	val_12
-284	val_284
-180	val_180
-332	val_332
+172	val_172
+172	val_173
 176	val_176
-216	val_216
 176	val_176
+180	val_180
+184	val_185
 192	val_192
-356	val_356
+192	val_193
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+204	val_205
 208	val_208
-280	val_280
-4	val_4
-72	val_72
-92	val_92
-20	val_20
-316	val_316
-128	val_128
-0	val_0
-396	val_396
 208	val_208
-292	val_292
-252	val_252
-152	val_152
-128	val_128
+208	val_208
+212	val_213
+216	val_216
+216	val_216
+216	val_217
 224	val_224
-484	val_484
+224	val_224
+224	val_225
+228	val_228
+228	val_229
+240	val_241
+244	val_244
+244	val_245
 244	val_245
-300	val_301
-76	val_77
-152	val_153
-468	val_469
-308	val_309
-100	val_101
-440	val_441
-196	val_197
-276	val_277
 244	val_245
+248	val_248
 248	val_249
-228	val_229
-156	val_157
-100	val_101
-40	val_41
-412	val_413
-292	val_293
+252	val_252
+252	val_253
+256	val_256
+256	val_256
 256	val_257
-152	val_153
-52	val_53
-292	val_293
-348	val_349
-152	val_153
-408	val_409
-144	val_145
-496	val_497
-432	val_433
-136	val_137
-164	val_165
-284	val_285
-244	val_245
-172	val_173
-156	val_157
-436	val_437
-104	val_105
-392	val_393
+260	val_260
+260	val_261
+260	val_261
+264	val_265
+264	val_265
 268	val_269
-0	val_1
+272	val_272
+272	val_272
+272	val_273
+276	val_277
+280	val_280
+280	val_280
+284	val_284
+284	val_285
+284	val_285
+288	val_288
+288	val_288
+292	val_292
+292	val_293
+292	val_293
+296	val_296
+296	val_297
 300	val_301
-404	val_405
-52	val_53
-60	val_61
-384	val_385
-12	val_13
-196	val_197
-216	val_217
-204	val_205
-16	val_17
-412	val_413
-76	val_77
-160	val_161
-52	val_53
+300	val_301
+304	val_305
+308	val_308
+308	val_309
+308	val_309
+316	val_316
+316	val_316
+316	val_316
+324	val_325
+328	val_329
+328	val_329
+332	val_332
+336	val_336
+336	val_337
+340	val_341
+344	val_344
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_349
+352	val_353
 352	val_353
+356	val_356
 356	val_357
-192	val_193
-132	val_133
-32	val_33
-104	val_105
-116	val_117
-76	val_77
+356	val_357
+360	val_360
+360	val_361
+364	val_364
+364	val_365
+368	val_368
+376	val_377
+384	val_384
+384	val_384
+384	val_384
 384	val_385
+384	val_385
+384	val_385
+388	val_389
+392	val_392
+392	val_393
+392	val_393
+396	val_396
+396	val_396
+396	val_396
+400	val_400
+404	val_404
+404	val_404
 404	val_405
-328	val_329
-260	val_261
 404	val_405
-324	val_325
-384	val_385
-168	val_169
-8	val_9
-40	val_41
-52	val_53
-20	val_21
-364	val_365
+404	val_405
+408	val_409
+408	val_409
+412	val_413
+412	val_413
 416	val_417
-308	val_309
-212	val_213
-140	val_141
-80	val_81
-104	val_105
-164	val_165
-260	val_261
-484	val_485
-340	val_341
-336	val_337
-48	val_49
-264	val_265
-252	val_253
+424	val_424
+424	val_424
+424	val_425
+428	val_429
+432	val_432
+432	val_433
+436	val_436
+436	val_437
+440	val_441
+440	val_441
+444	val_444
+448	val_448
+448	val_449
+452	val_452
+460	val_460
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+472	val_472
 476	val_477
-392	val_393
+476	val_477
+480	val_480
+480	val_480
+480	val_480
 480	val_481
 480	val_481
-328	val_329
-352	val_353
-284	val_285
-184	val_185
-388	val_389
-132	val_133
-120	val_121
-376	val_377
+484	val_484
+484	val_485
+488	val_489
+492	val_492
+492	val_492
 492	val_493
-16	val_17
-68	val_69
-360	val_361
 492	val_493
-20	val_21
-196	val_197
-264	val_265
-304	val_305
-56	val_57
-4	val_5
-344	val_345
-224	val_225
-468	val_469
-128	val_129
-488	val_489
-424	val_425
-48	val_49
-476	val_477
-408	val_409
-240	val_241
-0	val_1
-128	val_129
+496	val_496
+496	val_497
 PREHOOK: query: EXPLAIN EXTENDED SELECT s.* FROM srcbucket TABLESAMPLE (BUCKET 4 OUT OF 4 on key) s
 ORDER BY key, value
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/sample7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample7.q.out b/ql/src/test/results/clientpositive/sample7.q.out
index 1d0f0e8..182bd4a 100644
--- a/ql/src/test/results/clientpositive/sample7.q.out
+++ b/ql/src/test/results/clientpositive/sample7.q.out
@@ -356,208 +356,210 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-356	val_357
-428	val_429
-296	val_297
-440	val_441
-448	val_449
-272	val_273
-468	val_469
-200	val_200
-400	val_400
-348	val_348
-152	val_152
-448	val_448
-344	val_344
-348	val_348
-492	val_492
-384	val_384
-256	val_256
-384	val_384
-172	val_172
-136	val_136
-480	val_480
-460	val_460
-468	val_468
-120	val_120
-444	val_444
-248	val_248
-360	val_360
-200	val_200
 104	val_104
-480	val_480
-424	val_424
-164	val_164
-164	val_164
-396	val_396
-424	val_424
-348	val_348
 104	val_104
-280	val_280
-316	val_316
-432	val_432
-128	val_128
-244	val_244
-288	val_288
-480	val_480
-256	val_256
+104	val_105
+104	val_105
+104	val_105
 116	val_116
-344	val_344
-216	val_216
-296	val_296
-368	val_368
-468	val_468
-228	val_228
-492	val_492
+116	val_117
+120	val_120
+120	val_120
+120	val_121
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+136	val_136
+136	val_137
+140	val_141
+144	val_145
+152	val_152
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
 160	val_160
-472	val_472
+160	val_161
+164	val_164
+164	val_164
+164	val_165
+164	val_165
 168	val_168
-336	val_336
-396	val_396
-452	val_452
-272	val_272
-392	val_392
-224	val_224
-364	val_364
-316	val_316
-288	val_288
-196	val_196
-308	val_308
-468	val_468
-156	val_156
-436	val_436
-404	val_404
-120	val_120
-468	val_468
-496	val_496
+168	val_169
 172	val_172
-348	val_348
-208	val_208
-348	val_348
-272	val_272
-384	val_384
-404	val_404
-260	val_260
-284	val_284
-180	val_180
-332	val_332
+172	val_172
+172	val_173
 176	val_176
-216	val_216
 176	val_176
+180	val_180
+184	val_185
 192	val_192
-356	val_356
+192	val_193
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+204	val_205
 208	val_208
-280	val_280
-316	val_316
-128	val_128
-396	val_396
 208	val_208
-292	val_292
-252	val_252
-152	val_152
-128	val_128
+208	val_208
+212	val_213
+216	val_216
+216	val_216
+216	val_217
 224	val_224
-484	val_484
+224	val_224
+224	val_225
+228	val_228
+228	val_229
+240	val_241
+244	val_244
+244	val_245
 244	val_245
-300	val_301
-152	val_153
-468	val_469
-308	val_309
-440	val_441
-196	val_197
-276	val_277
 244	val_245
+248	val_248
 248	val_249
-228	val_229
-156	val_157
-412	val_413
-292	val_293
+252	val_252
+252	val_253
+256	val_256
+256	val_256
 256	val_257
-152	val_153
-292	val_293
-348	val_349
-152	val_153
-408	val_409
-144	val_145
-496	val_497
-432	val_433
-136	val_137
-164	val_165
-284	val_285
-244	val_245
-172	val_173
-156	val_157
-436	val_437
-104	val_105
-392	val_393
+260	val_260
+260	val_261
+260	val_261
+264	val_265
+264	val_265
 268	val_269
+272	val_272
+272	val_272
+272	val_273
+276	val_277
+280	val_280
+280	val_280
+284	val_284
+284	val_285
+284	val_285
+288	val_288
+288	val_288
+292	val_292
+292	val_293
+292	val_293
+296	val_296
+296	val_297
 300	val_301
-404	val_405
-384	val_385
-196	val_197
-216	val_217
-204	val_205
-412	val_413
-160	val_161
+300	val_301
+304	val_305
+308	val_308
+308	val_309
+308	val_309
+316	val_316
+316	val_316
+316	val_316
+324	val_325
+328	val_329
+328	val_329
+332	val_332
+336	val_336
+336	val_337
+340	val_341
+344	val_344
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_349
 352	val_353
+352	val_353
+356	val_356
 356	val_357
-192	val_193
-132	val_133
-104	val_105
-116	val_117
+356	val_357
+360	val_360
+360	val_361
+364	val_364
+364	val_365
+368	val_368
+376	val_377
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
 384	val_385
+388	val_389
+392	val_392
+392	val_393
+392	val_393
+396	val_396
+396	val_396
+396	val_396
+400	val_400
+404	val_404
+404	val_404
 404	val_405
-328	val_329
-260	val_261
 404	val_405
-324	val_325
-384	val_385
-168	val_169
-364	val_365
+404	val_405
+408	val_409
+408	val_409
+412	val_413
+412	val_413
 416	val_417
-308	val_309
-212	val_213
-140	val_141
-104	val_105
-164	val_165
-260	val_261
-484	val_485
-340	val_341
-336	val_337
-264	val_265
-252	val_253
+424	val_424
+424	val_424
+424	val_425
+428	val_429
+432	val_432
+432	val_433
+436	val_436
+436	val_437
+440	val_441
+440	val_441
+444	val_444
+448	val_448
+448	val_449
+452	val_452
+460	val_460
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+472	val_472
 476	val_477
-392	val_393
+476	val_477
+480	val_480
+480	val_480
+480	val_480
 480	val_481
 480	val_481
-328	val_329
-352	val_353
-284	val_285
-184	val_185
-388	val_389
-132	val_133
-120	val_121
-376	val_377
+484	val_484
+484	val_485
+488	val_489
+492	val_492
+492	val_492
 492	val_493
-360	val_361
 492	val_493
-196	val_197
-264	val_265
-304	val_305
-344	val_345
-224	val_225
-468	val_469
-128	val_129
-488	val_489
-424	val_425
-476	val_477
-408	val_409
-240	val_241
-128	val_129
+496	val_496
+496	val_497

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/sample9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample9.q.out b/ql/src/test/results/clientpositive/sample9.q.out
index f4afad4..854333b 100644
--- a/ql/src/test/results/clientpositive/sample9.q.out
+++ b/ql/src/test/results/clientpositive/sample9.q.out
@@ -109,504 +109,506 @@ STAGE PLANS:
 
 PREHOOK: query: SELECT s.*
 FROM (SELECT a.* FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) a) s
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcbucket
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT s.*
 FROM (SELECT a.* FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 2 on key) a) s
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@srcbucket
 #### A masked pattern was here ####
-490	val_491
-356	val_357
-106	val_107
-126	val_127
-428	val_429
-296	val_297
-278	val_279
-440	val_441
-246	val_247
-448	val_449
-272	val_273
-468	val_469
-62	val_63
-474	val_475
-200	val_200
-400	val_400
-90	val_90
-126	val_126
-222	val_222
-414	val_414
-194	val_194
-348	val_348
-152	val_152
-448	val_448
-28	val_28
-84	val_84
-344	val_344
+0	val_0
+0	val_0
+0	val_0
+0	val_1
+0	val_1
+2	val_2
+2	val_3
+4	val_4
+4	val_5
+6	val_7
+6	val_7
+8	val_8
+8	val_9
+10	val_10
+10	val_11
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
 18	val_18
-348	val_348
-186	val_186
-362	val_362
-458	val_458
-146	val_146
-498	val_498
-298	val_298
-100	val_100
-492	val_492
-462	val_462
 18	val_18
-384	val_384
-134	val_134
+20	val_20
+20	val_21
+20	val_21
+22	val_23
+24	val_24
+24	val_24
 26	val_26
-256	val_256
-384	val_384
-454	val_454
-406	val_406
-462	val_462
-214	val_214
-172	val_172
-136	val_136
-480	val_480
-460	val_460
-310	val_310
-468	val_468
-178	val_178
-478	val_478
-230	val_230
-120	val_120
-444	val_444
-248	val_248
-360	val_360
-200	val_200
-414	val_414
-438	val_438
+26	val_26
+28	val_28
+30	val_30
+30	val_31
+32	val_33
+34	val_34
+40	val_41
+40	val_41
+42	val_42
+42	val_42
+42	val_43
+42	val_43
+42	val_43
+44	val_44
+46	val_47
+48	val_49
+48	val_49
+50	val_51
+52	val_53
+52	val_53
+52	val_53
+52	val_53
+54	val_54
+56	val_57
+58	val_58
+58	val_58
+58	val_59
+58	val_59
+60	val_61
+62	val_63
+62	val_63
+64	val_64
+66	val_66
+68	val_69
 70	val_70
-104	val_104
-24	val_24
-480	val_480
 70	val_70
-382	val_382
-424	val_424
-164	val_164
-298	val_298
-478	val_478
-454	val_454
-164	val_164
-396	val_396
-12	val_12
-424	val_424
-348	val_348
-262	val_262
-90	val_90
-258	val_258
-114	val_114
-406	val_406
-190	val_190
-406	val_406
-366	val_366
-466	val_466
-104	val_104
-44	val_44
-80	val_80
-2	val_2
-280	val_280
-316	val_316
-202	val_202
-432	val_432
-128	val_128
-438	val_438
-244	val_244
-288	val_288
-480	val_480
 70	val_70
-256	val_256
-116	val_116
-274	val_274
-344	val_344
-216	val_216
-296	val_296
-368	val_368
-230	val_230
-342	val_342
+70	val_71
+72	val_72
+72	val_72
 74	val_74
 76	val_76
-468	val_468
-64	val_64
-30	val_30
-138	val_138
-228	val_228
-218	val_218
-492	val_492
 76	val_76
+76	val_77
+76	val_77
+76	val_77
 78	val_78
-458	val_458
-430	val_430
-42	val_42
-160	val_160
-498	val_498
-322	val_322
-472	val_472
-34	val_34
-168	val_168
-336	val_336
-58	val_58
-396	val_396
-402	val_402
-226	val_226
-452	val_452
-242	val_242
-272	val_272
-392	val_392
-242	val_242
-224	val_224
-306	val_306
-10	val_10
+78	val_79
+80	val_80
+80	val_81
+82	val_82
+82	val_83
+82	val_83
+84	val_84
+84	val_84
+86	val_86
+86	val_87
 90	val_90
-72	val_72
-118	val_118
-238	val_238
-138	val_138
-282	val_282
-134	val_134
-118	val_118
-364	val_364
-490	val_490
-0	val_0
-316	val_316
-470	val_470
-318	val_318
-318	val_318
-282	val_282
-98	val_98
-288	val_288
-196	val_196
-308	val_308
-468	val_468
-156	val_156
-436	val_436
-404	val_404
-120	val_120
-230	val_230
-26	val_26
+90	val_90
+90	val_90
+92	val_92
+94	val_95
 96	val_96
-418	val_418
-298	val_298
+98	val_98
+98	val_98
 100	val_100
-454	val_454
-468	val_468
-322	val_322
-0	val_0
-496	val_496
-158	val_158
-42	val_42
-172	val_172
-24	val_24
-348	val_348
-208	val_208
-230	val_230
-8	val_8
-58	val_58
-466	val_466
-348	val_348
-84	val_84
+100	val_100
+100	val_101
+100	val_101
+102	val_103
+104	val_104
+104	val_104
+104	val_105
+104	val_105
+104	val_105
+106	val_107
+110	val_111
+114	val_114
+114	val_115
+114	val_115
+114	val_115
+116	val_116
+116	val_117
+118	val_118
+118	val_118
+118	val_119
+118	val_119
+118	val_119
+120	val_120
+120	val_120
+120	val_121
+122	val_123
+122	val_123
+122	val_123
+126	val_126
+126	val_127
+126	val_127
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+134	val_134
+134	val_134
+134	val_135
+136	val_136
+136	val_137
 138	val_138
-272	val_272
-384	val_384
-404	val_404
-260	val_260
-230	val_230
-12	val_12
-284	val_284
-180	val_180
-332	val_332
-318	val_318
-176	val_176
-278	val_278
-430	val_430
-216	val_216
 138	val_138
-54	val_54
+138	val_138
+138	val_138
+138	val_139
+138	val_139
+140	val_141
+144	val_145
+146	val_146
+146	val_146
+150	val_150
+152	val_152
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
+158	val_158
+160	val_160
+160	val_161
+162	val_162
+162	val_163
+164	val_164
+164	val_164
+164	val_165
+164	val_165
+166	val_166
+168	val_168
+168	val_169
+170	val_170
+170	val_171
+172	val_172
+172	val_172
+172	val_173
+174	val_174
+174	val_174
+174	val_175
+174	val_175
 176	val_176
-286	val_286
+176	val_176
+178	val_178
+178	val_179
+178	val_179
+180	val_180
+182	val_183
+184	val_185
+186	val_186
+190	val_190
 192	val_192
-386	val_386
-498	val_498
-382	val_382
-356	val_356
+192	val_193
+194	val_194
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+202	val_202
+204	val_205
+206	val_207
+206	val_207
+206	val_207
 208	val_208
-280	val_280
-4	val_4
-72	val_72
-92	val_92
-378	val_378
-20	val_20
-170	val_170
-438	val_438
-302	val_302
-316	val_316
-128	val_128
-0	val_0
-342	val_342
-266	val_266
-162	val_162
-396	val_396
-174	val_174
 208	val_208
-466	val_466
-494	val_494
-174	val_174
-482	val_482
-394	val_394
-446	val_446
-338	val_338
-292	val_292
-252	val_252
-430	val_430
-166	val_166
-82	val_82
-152	val_152
-374	val_374
-406	val_406
-146	val_146
-128	val_128
-66	val_66
+208	val_208
+212	val_213
+214	val_214
+216	val_216
+216	val_216
+216	val_217
+218	val_218
+222	val_222
+222	val_223
 224	val_224
-150	val_150
-484	val_484
-98	val_98
-278	val_278
-86	val_86
+224	val_224
+224	val_225
+226	val_226
+226	val_227
+226	val_227
+226	val_227
+226	val_227
+228	val_228
+228	val_229
+230	val_230
+230	val_230
+230	val_230
+230	val_230
+230	val_230
 238	val_238
-244	val_245
+238	val_238
+238	val_239
+240	val_241
+242	val_242
+242	val_242
 242	val_243
-178	val_179
-118	val_119
-478	val_479
-300	val_301
-76	val_77
-138	val_139
-152	val_153
-468	val_469
-430	val_431
-308	val_309
-100	val_101
-440	val_441
-82	val_83
-410	val_411
-196	val_197
-134	val_135
-78	val_79
-46	val_47
-276	val_277
+244	val_244
 244	val_245
-162	val_163
-62	val_63
-402	val_403
+244	val_245
+244	val_245
+246	val_247
+246	val_247
+248	val_248
 248	val_249
-22	val_23
-228	val_229
-156	val_157
-100	val_101
-178	val_179
-478	val_479
-40	val_41
-412	val_413
-292	val_293
+252	val_252
+252	val_253
+254	val_255
+256	val_256
+256	val_256
 256	val_257
-414	val_415
-378	val_379
-152	val_153
-486	val_487
-52	val_53
-310	val_311
-474	val_475
-182	val_183
+258	val_258
+258	val_259
+260	val_260
+260	val_261
+260	val_261
+262	val_262
+262	val_263
+262	val_263
+264	val_265
+264	val_265
+266	val_266
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+274	val_274
+274	val_275
+276	val_277
+278	val_278
+278	val_278
+278	val_279
+280	val_280
+280	val_280
+282	val_282
+282	val_282
+284	val_284
+284	val_285
+284	val_285
+286	val_286
+286	val_287
+288	val_288
+288	val_288
+292	val_292
 292	val_293
-122	val_123
+292	val_293
+296	val_296
+296	val_297
+298	val_298
+298	val_298
+298	val_298
+300	val_301
+300	val_301
+302	val_302
+302	val_303
+304	val_305
+306	val_306
+306	val_307
+308	val_308
+308	val_309
+308	val_309
+310	val_310
+310	val_311
+310	val_311
+310	val_311
+314	val_315
+316	val_316
+316	val_316
+316	val_316
+318	val_318
+318	val_318
+318	val_318
+318	val_319
+322	val_322
+322	val_322
+322	val_323
+324	val_325
+326	val_327
+328	val_329
+328	val_329
+330	val_331
+332	val_332
+334	val_335
+336	val_336
+336	val_337
+338	val_338
+338	val_339
+340	val_341
+342	val_342
+342	val_342
+342	val_343
+344	val_344
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
 348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+358	val_359
+360	val_360
+360	val_361
+362	val_362
+364	val_364
+364	val_365
+366	val_366
+368	val_368
+374	val_374
+374	val_375
+376	val_377
+378	val_378
+378	val_379
+382	val_382
+382	val_382
 382	val_383
-152	val_153
+382	val_383
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+386	val_386
+386	val_387
+386	val_387
+388	val_389
+390	val_391
+390	val_391
+390	val_391
+392	val_392
+392	val_393
+392	val_393
+394	val_394
+396	val_396
+396	val_396
+396	val_396
+398	val_399
+400	val_400
+402	val_402
+402	val_403
+402	val_403
+402	val_403
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
+406	val_406
+406	val_406
+406	val_406
+406	val_406
+406	val_407
 408	val_409
-144	val_145
-496	val_497
+408	val_409
+410	val_411
+412	val_413
+412	val_413
+414	val_414
+414	val_414
+414	val_415
+416	val_417
+418	val_418
+424	val_424
+424	val_424
+424	val_425
+426	val_427
+428	val_429
+430	val_430
+430	val_430
+430	val_430
+430	val_431
+432	val_432
 432	val_433
-462	val_463
-136	val_137
-164	val_165
-284	val_285
-6	val_7
-244	val_245
-172	val_173
-118	val_119
-156	val_157
+436	val_436
 436	val_437
-104	val_105
-392	val_393
-268	val_269
-0	val_1
-300	val_301
-446	val_447
-404	val_405
-52	val_53
+438	val_438
+438	val_438
+438	val_438
+438	val_439
+438	val_439
+440	val_441
+440	val_441
 442	val_443
-60	val_61
-384	val_385
-334	val_335
-398	val_399
-12	val_13
+444	val_444
+446	val_446
+446	val_447
+446	val_447
+448	val_448
+448	val_449
 450	val_451
-302	val_303
-196	val_197
-470	val_471
-216	val_217
-494	val_495
-374	val_375
-274	val_275
-126	val_127
-204	val_205
-16	val_17
-412	val_413
-174	val_175
-76	val_77
+450	val_451
+452	val_452
+454	val_454
+454	val_454
+454	val_454
 454	val_455
-160	val_161
-138	val_139
-330	val_331
-52	val_53
-352	val_353
-356	val_357
-70	val_71
-58	val_59
-192	val_193
-132	val_133
-32	val_33
-406	val_407
-104	val_105
-42	val_43
-116	val_117
-76	val_77
-384	val_385
-404	val_405
-122	val_123
-322	val_323
-328	val_329
-260	val_261
-262	val_263
-226	val_227
-206	val_207
-404	val_405
-206	val_207
-310	val_311
-324	val_325
-384	val_385
-168	val_169
-8	val_9
-40	val_41
-52	val_53
-20	val_21
-364	val_365
 454	val_455
-386	val_387
-42	val_43
-416	val_417
-358	val_359
-30	val_31
-308	val_309
-212	val_213
-140	val_141
-450	val_451
-326	val_327
-80	val_81
-104	val_105
-310	val_311
-118	val_119
-164	val_165
-170	val_171
-2	val_3
-260	val_261
-6	val_7
-484	val_485
-390	val_391
-340	val_341
-336	val_337
-48	val_49
-264	val_265
-114	val_115
-252	val_253
-174	val_175
-258	val_259
+458	val_458
+458	val_458
+460	val_460
+462	val_462
+462	val_462
+462	val_463
+466	val_466
+466	val_466
+466	val_466
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+470	val_470
+470	val_471
+472	val_472
+474	val_475
+474	val_475
 476	val_477
-392	val_393
-318	val_319
+476	val_477
+478	val_478
+478	val_478
+478	val_479
+478	val_479
+480	val_480
+480	val_480
+480	val_480
 480	val_481
-102	val_103
 480	val_481
-342	val_343
-382	val_383
-328	val_329
-226	val_227
-352	val_353
-390	val_391
-438	val_439
-122	val_123
-262	val_263
-246	val_247
-284	val_285
-184	val_185
-388	val_389
-386	val_387
-446	val_447
-132	val_133
-426	val_427
-306	val_307
-120	val_121
-376	val_377
+482	val_482
+482	val_483
+484	val_484
+484	val_485
+486	val_487
+488	val_489
+490	val_490
+490	val_491
+492	val_492
+492	val_492
 492	val_493
-16	val_17
-68	val_69
-338	val_339
-42	val_43
-222	val_223
-360	val_361
-438	val_439
-86	val_87
-58	val_59
-82	val_83
 492	val_493
-20	val_21
-238	val_239
-196	val_197
-264	val_265
-304	val_305
-390	val_391
-254	val_255
-114	val_115
-56	val_57
-114	val_115
-206	val_207
-4	val_5
-344	val_345
-224	val_225
-314	val_315
-468	val_469
-128	val_129
-402	val_403
-50	val_51
-94	val_95
-488	val_489
+494	val_494
 494	val_495
-226	val_227
-424	val_425
-48	val_49
-482	val_483
-476	val_477
-408	val_409
-286	val_287
-240	val_241
-0	val_1
-110	val_111
-226	val_227
-10	val_11
-128	val_129
-402	val_403
+494	val_495
+496	val_496
+496	val_497
+498	val_498
+498	val_498
+498	val_498

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/spark/sample2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/sample2.q.out b/ql/src/test/results/clientpositive/spark/sample2.q.out
index fa230aa..4b1abb2 100644
--- a/ql/src/test/results/clientpositive/spark/sample2.q.out
+++ b/ql/src/test/results/clientpositive/spark/sample2.q.out
@@ -170,503 +170,505 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-474	val_475
-62	val_63
-468	val_469
-272	val_273
-448	val_449
-246	val_247
-440	val_441
-278	val_279
-296	val_297
-428	val_429
-126	val_127
-106	val_107
-356	val_357
-490	val_491
-402	val_403
-128	val_129
-10	val_11
-226	val_227
-110	val_111
+0	val_0
+0	val_0
+0	val_0
 0	val_1
-240	val_241
-286	val_287
-408	val_409
-476	val_477
-482	val_483
-48	val_49
-424	val_425
-226	val_227
-494	val_495
-488	val_489
-94	val_95
-50	val_51
-402	val_403
-128	val_129
-468	val_469
-314	val_315
-224	val_225
-344	val_345
+0	val_1
+2	val_2
+2	val_3
+4	val_4
 4	val_5
-206	val_207
-114	val_115
-56	val_57
-114	val_115
-254	val_255
-390	val_391
-304	val_305
-264	val_265
-196	val_197
-238	val_239
-20	val_21
-492	val_493
-82	val_83
-58	val_59
-86	val_87
-438	val_439
-360	val_361
-222	val_223
-42	val_43
-338	val_339
-68	val_69
-16	val_17
-492	val_493
-376	val_377
-120	val_121
-306	val_307
-426	val_427
-132	val_133
-446	val_447
-386	val_387
-388	val_389
-184	val_185
-284	val_285
-246	val_247
-262	val_263
-122	val_123
-438	val_439
-390	val_391
-352	val_353
-226	val_227
-328	val_329
-382	val_383
-342	val_343
-480	val_481
-102	val_103
-480	val_481
-318	val_319
-392	val_393
-476	val_477
-258	val_259
-174	val_175
-252	val_253
-114	val_115
-264	val_265
-48	val_49
-336	val_337
-340	val_341
-390	val_391
-484	val_485
 6	val_7
-260	val_261
-2	val_3
-170	val_171
-164	val_165
-118	val_119
-310	val_311
-104	val_105
-80	val_81
-326	val_327
-450	val_451
-140	val_141
-212	val_213
-308	val_309
-30	val_31
-358	val_359
-416	val_417
-42	val_43
-386	val_387
-454	val_455
-364	val_365
+6	val_7
+8	val_8
+8	val_9
+10	val_10
+10	val_11
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
+18	val_18
+18	val_18
+20	val_20
 20	val_21
-52	val_53
+20	val_21
+22	val_23
+24	val_24
+24	val_24
+26	val_26
+26	val_26
+28	val_28
+30	val_30
+30	val_31
+32	val_33
+34	val_34
 40	val_41
-8	val_9
-168	val_169
-384	val_385
-324	val_325
-310	val_311
-206	val_207
-404	val_405
-206	val_207
-226	val_227
-262	val_263
-260	val_261
-328	val_329
-322	val_323
-122	val_123
-404	val_405
-384	val_385
-76	val_77
-116	val_117
+40	val_41
+42	val_42
+42	val_42
 42	val_43
-104	val_105
-406	val_407
-32	val_33
-132	val_133
-192	val_193
-58	val_59
-70	val_71
-356	val_357
-352	val_353
+42	val_43
+42	val_43
+44	val_44
+46	val_47
+48	val_49
+48	val_49
+50	val_51
 52	val_53
-330	val_331
-138	val_139
-160	val_161
-454	val_455
-76	val_77
-174	val_175
-412	val_413
-16	val_17
-204	val_205
-126	val_127
-274	val_275
-374	val_375
-494	val_495
-216	val_217
-470	val_471
-196	val_197
-302	val_303
-450	val_451
-12	val_13
-398	val_399
-334	val_335
-384	val_385
-60	val_61
-442	val_443
 52	val_53
-404	val_405
-446	val_447
-300	val_301
-0	val_1
-268	val_269
-392	val_393
-104	val_105
-436	val_437
-156	val_157
-118	val_119
-172	val_173
-244	val_245
-6	val_7
-284	val_285
-164	val_165
-136	val_137
-462	val_463
-432	val_433
-496	val_497
-144	val_145
-408	val_409
-152	val_153
-382	val_383
-348	val_349
-122	val_123
-292	val_293
-182	val_183
-474	val_475
-310	val_311
 52	val_53
-486	val_487
-152	val_153
-378	val_379
-414	val_415
-256	val_257
-292	val_293
-412	val_413
-40	val_41
-478	val_479
-178	val_179
-100	val_101
-156	val_157
-228	val_229
-22	val_23
-248	val_249
-402	val_403
+52	val_53
+54	val_54
+56	val_57
+58	val_58
+58	val_58
+58	val_59
+58	val_59
+60	val_61
 62	val_63
-162	val_163
-244	val_245
-276	val_277
-46	val_47
+62	val_63
+64	val_64
+66	val_66
+68	val_69
+70	val_70
+70	val_70
+70	val_70
+70	val_71
+72	val_72
+72	val_72
+74	val_74
+76	val_76
+76	val_76
+76	val_77
+76	val_77
+76	val_77
+78	val_78
 78	val_79
-134	val_135
-196	val_197
-410	val_411
+80	val_80
+80	val_81
+82	val_82
 82	val_83
-440	val_441
-100	val_101
-308	val_309
-430	val_431
-468	val_469
-152	val_153
-138	val_139
-76	val_77
-300	val_301
-478	val_479
-118	val_119
-178	val_179
-242	val_243
-244	val_245
-238	val_238
+82	val_83
+84	val_84
+84	val_84
 86	val_86
-278	val_278
+86	val_87
+90	val_90
+90	val_90
+90	val_90
+92	val_92
+94	val_95
+96	val_96
 98	val_98
-484	val_484
-150	val_150
-224	val_224
-66	val_66
+98	val_98
+100	val_100
+100	val_100
+100	val_101
+100	val_101
+102	val_103
+104	val_104
+104	val_104
+104	val_105
+104	val_105
+104	val_105
+106	val_107
+110	val_111
+114	val_114
+114	val_115
+114	val_115
+114	val_115
+116	val_116
+116	val_117
+118	val_118
+118	val_118
+118	val_119
+118	val_119
+118	val_119
+120	val_120
+120	val_120
+120	val_121
+122	val_123
+122	val_123
+122	val_123
+126	val_126
+126	val_127
+126	val_127
 128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+134	val_134
+134	val_134
+134	val_135
+136	val_136
+136	val_137
+138	val_138
+138	val_138
+138	val_138
+138	val_138
+138	val_139
+138	val_139
+140	val_141
+144	val_145
 146	val_146
-406	val_406
-374	val_374
+146	val_146
+150	val_150
 152	val_152
-82	val_82
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
+158	val_158
+160	val_160
+160	val_161
+162	val_162
+162	val_163
+164	val_164
+164	val_164
+164	val_165
+164	val_165
 166	val_166
-430	val_430
-252	val_252
-292	val_292
-338	val_338
-446	val_446
-394	val_394
-482	val_482
+168	val_168
+168	val_169
+170	val_170
+170	val_171
+172	val_172
+172	val_172
+172	val_173
 174	val_174
-494	val_494
-466	val_466
-208	val_208
 174	val_174
-396	val_396
-162	val_162
-266	val_266
-342	val_342
-0	val_0
-128	val_128
-316	val_316
-302	val_302
-438	val_438
-170	val_170
-20	val_20
-378	val_378
-92	val_92
-72	val_72
-4	val_4
-280	val_280
-208	val_208
-356	val_356
-382	val_382
-498	val_498
-386	val_386
-192	val_192
-286	val_286
+174	val_175
+174	val_175
 176	val_176
-54	val_54
-138	val_138
-216	val_216
-430	val_430
-278	val_278
 176	val_176
-318	val_318
-332	val_332
+178	val_178
+178	val_179
+178	val_179
 180	val_180
-284	val_284
-12	val_12
+182	val_183
+184	val_185
+186	val_186
+190	val_190
+192	val_192
+192	val_193
+194	val_194
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+202	val_202
+204	val_205
+206	val_207
+206	val_207
+206	val_207
+208	val_208
+208	val_208
+208	val_208
+212	val_213
+214	val_214
+216	val_216
+216	val_216
+216	val_217
+218	val_218
+222	val_222
+222	val_223
+224	val_224
+224	val_224
+224	val_225
+226	val_226
+226	val_227
+226	val_227
+226	val_227
+226	val_227
+228	val_228
+228	val_229
+230	val_230
+230	val_230
 230	val_230
-260	val_260
-404	val_404
-384	val_384
-272	val_272
-138	val_138
-84	val_84
-348	val_348
-466	val_466
-58	val_58
-8	val_8
 230	val_230
-208	val_208
-348	val_348
-24	val_24
-172	val_172
-42	val_42
-158	val_158
-496	val_496
-0	val_0
-322	val_322
-468	val_468
-454	val_454
-100	val_100
-298	val_298
-418	val_418
-96	val_96
-26	val_26
 230	val_230
-120	val_120
-404	val_404
-436	val_436
-156	val_156
-468	val_468
-308	val_308
-196	val_196
-288	val_288
-98	val_98
-282	val_282
-318	val_318
-318	val_318
-470	val_470
-316	val_316
-0	val_0
-490	val_490
-364	val_364
-118	val_118
-134	val_134
-282	val_282
-138	val_138
 238	val_238
-118	val_118
-72	val_72
-90	val_90
-10	val_10
-306	val_306
-224	val_224
+238	val_238
+238	val_239
+240	val_241
 242	val_242
-392	val_392
-272	val_272
 242	val_242
-452	val_452
-226	val_226
-402	val_402
-396	val_396
-58	val_58
-336	val_336
-168	val_168
-34	val_34
-472	val_472
-322	val_322
-498	val_498
-160	val_160
-42	val_42
-430	val_430
-458	val_458
-78	val_78
-76	val_76
-492	val_492
-218	val_218
-228	val_228
-138	val_138
-30	val_30
-64	val_64
-468	val_468
-76	val_76
-74	val_74
+242	val_243
+244	val_244
+244	val_245
+244	val_245
+244	val_245
+246	val_247
+246	val_247
+248	val_248
+248	val_249
+252	val_252
+252	val_253
+254	val_255
+256	val_256
+256	val_256
+256	val_257
+258	val_258
+258	val_259
+260	val_260
+260	val_261
+260	val_261
+262	val_262
+262	val_263
+262	val_263
+264	val_265
+264	val_265
+266	val_266
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+274	val_274
+274	val_275
+276	val_277
+278	val_278
+278	val_278
+278	val_279
+280	val_280
+280	val_280
+282	val_282
+282	val_282
+284	val_284
+284	val_285
+284	val_285
+286	val_286
+286	val_287
+288	val_288
+288	val_288
+292	val_292
+292	val_293
+292	val_293
+296	val_296
+296	val_297
+298	val_298
+298	val_298
+298	val_298
+300	val_301
+300	val_301
+302	val_302
+302	val_303
+304	val_305
+306	val_306
+306	val_307
+308	val_308
+308	val_309
+308	val_309
+310	val_310
+310	val_311
+310	val_311
+310	val_311
+314	val_315
+316	val_316
+316	val_316
+316	val_316
+318	val_318
+318	val_318
+318	val_318
+318	val_319
+322	val_322
+322	val_322
+322	val_323
+324	val_325
+326	val_327
+328	val_329
+328	val_329
+330	val_331
+332	val_332
+334	val_335
+336	val_336
+336	val_337
+338	val_338
+338	val_339
+340	val_341
 342	val_342
-230	val_230
-368	val_368
-296	val_296
-216	val_216
+342	val_342
+342	val_343
 344	val_344
-274	val_274
-116	val_116
-256	val_256
-70	val_70
-480	val_480
-288	val_288
-244	val_244
-438	val_438
-128	val_128
-432	val_432
-202	val_202
-316	val_316
-280	val_280
-2	val_2
-80	val_80
-44	val_44
-104	val_104
-466	val_466
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+358	val_359
+360	val_360
+360	val_361
+362	val_362
+364	val_364
+364	val_365
 366	val_366
+368	val_368
+374	val_374
+374	val_375
+376	val_377
+378	val_378
+378	val_379
+382	val_382
+382	val_382
+382	val_383
+382	val_383
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+386	val_386
+386	val_387
+386	val_387
+388	val_389
+390	val_391
+390	val_391
+390	val_391
+392	val_392
+392	val_393
+392	val_393
+394	val_394
+396	val_396
+396	val_396
+396	val_396
+398	val_399
+400	val_400
+402	val_402
+402	val_403
+402	val_403
+402	val_403
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
 406	val_406
-190	val_190
 406	val_406
-114	val_114
-258	val_258
-90	val_90
-262	val_262
-348	val_348
+406	val_406
+406	val_406
+406	val_407
+408	val_409
+408	val_409
+410	val_411
+412	val_413
+412	val_413
+414	val_414
+414	val_414
+414	val_415
+416	val_417
+418	val_418
 424	val_424
-12	val_12
-396	val_396
-164	val_164
-454	val_454
-478	val_478
-298	val_298
-164	val_164
 424	val_424
-382	val_382
-70	val_70
-480	val_480
-24	val_24
-104	val_104
-70	val_70
+424	val_425
+426	val_427
+428	val_429
+430	val_430
+430	val_430
+430	val_430
+430	val_431
+432	val_432
+432	val_433
+436	val_436
+436	val_437
 438	val_438
-414	val_414
-200	val_200
-360	val_360
-248	val_248
+438	val_438
+438	val_438
+438	val_439
+438	val_439
+440	val_441
+440	val_441
+442	val_443
 444	val_444
-120	val_120
-230	val_230
-478	val_478
-178	val_178
-468	val_468
-310	val_310
+446	val_446
+446	val_447
+446	val_447
+448	val_448
+448	val_449
+450	val_451
+450	val_451
+452	val_452
+454	val_454
+454	val_454
+454	val_454
+454	val_455
+454	val_455
+458	val_458
+458	val_458
 460	val_460
-480	val_480
-136	val_136
-172	val_172
-214	val_214
 462	val_462
-406	val_406
-454	val_454
-384	val_384
-256	val_256
-26	val_26
-134	val_134
-384	val_384
-18	val_18
 462	val_462
+462	val_463
+466	val_466
+466	val_466
+466	val_466
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+470	val_470
+470	val_471
+472	val_472
+474	val_475
+474	val_475
+476	val_477
+476	val_477
+478	val_478
+478	val_478
+478	val_479
+478	val_479
+480	val_480
+480	val_480
+480	val_480
+480	val_481
+480	val_481
+482	val_482
+482	val_483
+484	val_484
+484	val_485
+486	val_487
+488	val_489
+490	val_490
+490	val_491
 492	val_492
-100	val_100
-298	val_298
+492	val_492
+492	val_493
+492	val_493
+494	val_494
+494	val_495
+494	val_495
+496	val_496
+496	val_497
+498	val_498
+498	val_498
 498	val_498
-146	val_146
-458	val_458
-362	val_362
-186	val_186
-348	val_348
-18	val_18
-344	val_344
-84	val_84
-28	val_28
-448	val_448
-152	val_152
-348	val_348
-194	val_194
-414	val_414
-222	val_222
-126	val_126
-90	val_90
-400	val_400
-200	val_200

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/spark/sample4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/sample4.q.out b/ql/src/test/results/clientpositive/spark/sample4.q.out
index 0f2af55..bad2942 100644
--- a/ql/src/test/results/clientpositive/spark/sample4.q.out
+++ b/ql/src/test/results/clientpositive/spark/sample4.q.out
@@ -170,503 +170,505 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-474	val_475
-62	val_63
-468	val_469
-272	val_273
-448	val_449
-246	val_247
-440	val_441
-278	val_279
-296	val_297
-428	val_429
-126	val_127
-106	val_107
-356	val_357
-490	val_491
-402	val_403
-128	val_129
-10	val_11
-226	val_227
-110	val_111
+0	val_0
+0	val_0
+0	val_0
 0	val_1
-240	val_241
-286	val_287
-408	val_409
-476	val_477
-482	val_483
-48	val_49
-424	val_425
-226	val_227
-494	val_495
-488	val_489
-94	val_95
-50	val_51
-402	val_403
-128	val_129
-468	val_469
-314	val_315
-224	val_225
-344	val_345
+0	val_1
+2	val_2
+2	val_3
+4	val_4
 4	val_5
-206	val_207
-114	val_115
-56	val_57
-114	val_115
-254	val_255
-390	val_391
-304	val_305
-264	val_265
-196	val_197
-238	val_239
-20	val_21
-492	val_493
-82	val_83
-58	val_59
-86	val_87
-438	val_439
-360	val_361
-222	val_223
-42	val_43
-338	val_339
-68	val_69
-16	val_17
-492	val_493
-376	val_377
-120	val_121
-306	val_307
-426	val_427
-132	val_133
-446	val_447
-386	val_387
-388	val_389
-184	val_185
-284	val_285
-246	val_247
-262	val_263
-122	val_123
-438	val_439
-390	val_391
-352	val_353
-226	val_227
-328	val_329
-382	val_383
-342	val_343
-480	val_481
-102	val_103
-480	val_481
-318	val_319
-392	val_393
-476	val_477
-258	val_259
-174	val_175
-252	val_253
-114	val_115
-264	val_265
-48	val_49
-336	val_337
-340	val_341
-390	val_391
-484	val_485
 6	val_7
-260	val_261
-2	val_3
-170	val_171
-164	val_165
-118	val_119
-310	val_311
-104	val_105
-80	val_81
-326	val_327
-450	val_451
-140	val_141
-212	val_213
-308	val_309
-30	val_31
-358	val_359
-416	val_417
-42	val_43
-386	val_387
-454	val_455
-364	val_365
+6	val_7
+8	val_8
+8	val_9
+10	val_10
+10	val_11
+12	val_12
+12	val_12
+12	val_13
+16	val_17
+16	val_17
+18	val_18
+18	val_18
+20	val_20
 20	val_21
-52	val_53
+20	val_21
+22	val_23
+24	val_24
+24	val_24
+26	val_26
+26	val_26
+28	val_28
+30	val_30
+30	val_31
+32	val_33
+34	val_34
 40	val_41
-8	val_9
-168	val_169
-384	val_385
-324	val_325
-310	val_311
-206	val_207
-404	val_405
-206	val_207
-226	val_227
-262	val_263
-260	val_261
-328	val_329
-322	val_323
-122	val_123
-404	val_405
-384	val_385
-76	val_77
-116	val_117
+40	val_41
+42	val_42
+42	val_42
 42	val_43
-104	val_105
-406	val_407
-32	val_33
-132	val_133
-192	val_193
-58	val_59
-70	val_71
-356	val_357
-352	val_353
+42	val_43
+42	val_43
+44	val_44
+46	val_47
+48	val_49
+48	val_49
+50	val_51
 52	val_53
-330	val_331
-138	val_139
-160	val_161
-454	val_455
-76	val_77
-174	val_175
-412	val_413
-16	val_17
-204	val_205
-126	val_127
-274	val_275
-374	val_375
-494	val_495
-216	val_217
-470	val_471
-196	val_197
-302	val_303
-450	val_451
-12	val_13
-398	val_399
-334	val_335
-384	val_385
-60	val_61
-442	val_443
 52	val_53
-404	val_405
-446	val_447
-300	val_301
-0	val_1
-268	val_269
-392	val_393
-104	val_105
-436	val_437
-156	val_157
-118	val_119
-172	val_173
-244	val_245
-6	val_7
-284	val_285
-164	val_165
-136	val_137
-462	val_463
-432	val_433
-496	val_497
-144	val_145
-408	val_409
-152	val_153
-382	val_383
-348	val_349
-122	val_123
-292	val_293
-182	val_183
-474	val_475
-310	val_311
 52	val_53
-486	val_487
-152	val_153
-378	val_379
-414	val_415
-256	val_257
-292	val_293
-412	val_413
-40	val_41
-478	val_479
-178	val_179
-100	val_101
-156	val_157
-228	val_229
-22	val_23
-248	val_249
-402	val_403
+52	val_53
+54	val_54
+56	val_57
+58	val_58
+58	val_58
+58	val_59
+58	val_59
+60	val_61
 62	val_63
-162	val_163
-244	val_245
-276	val_277
-46	val_47
+62	val_63
+64	val_64
+66	val_66
+68	val_69
+70	val_70
+70	val_70
+70	val_70
+70	val_71
+72	val_72
+72	val_72
+74	val_74
+76	val_76
+76	val_76
+76	val_77
+76	val_77
+76	val_77
+78	val_78
 78	val_79
-134	val_135
-196	val_197
-410	val_411
+80	val_80
+80	val_81
+82	val_82
 82	val_83
-440	val_441
-100	val_101
-308	val_309
-430	val_431
-468	val_469
-152	val_153
-138	val_139
-76	val_77
-300	val_301
-478	val_479
-118	val_119
-178	val_179
-242	val_243
-244	val_245
-238	val_238
+82	val_83
+84	val_84
+84	val_84
 86	val_86
-278	val_278
+86	val_87
+90	val_90
+90	val_90
+90	val_90
+92	val_92
+94	val_95
+96	val_96
 98	val_98
-484	val_484
-150	val_150
-224	val_224
-66	val_66
+98	val_98
+100	val_100
+100	val_100
+100	val_101
+100	val_101
+102	val_103
+104	val_104
+104	val_104
+104	val_105
+104	val_105
+104	val_105
+106	val_107
+110	val_111
+114	val_114
+114	val_115
+114	val_115
+114	val_115
+116	val_116
+116	val_117
+118	val_118
+118	val_118
+118	val_119
+118	val_119
+118	val_119
+120	val_120
+120	val_120
+120	val_121
+122	val_123
+122	val_123
+122	val_123
+126	val_126
+126	val_127
+126	val_127
 128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+134	val_134
+134	val_134
+134	val_135
+136	val_136
+136	val_137
+138	val_138
+138	val_138
+138	val_138
+138	val_138
+138	val_139
+138	val_139
+140	val_141
+144	val_145
 146	val_146
-406	val_406
-374	val_374
+146	val_146
+150	val_150
 152	val_152
-82	val_82
+152	val_152
+152	val_153
+152	val_153
+152	val_153
+156	val_156
+156	val_157
+156	val_157
+158	val_158
+160	val_160
+160	val_161
+162	val_162
+162	val_163
+164	val_164
+164	val_164
+164	val_165
+164	val_165
 166	val_166
-430	val_430
-252	val_252
-292	val_292
-338	val_338
-446	val_446
-394	val_394
-482	val_482
+168	val_168
+168	val_169
+170	val_170
+170	val_171
+172	val_172
+172	val_172
+172	val_173
 174	val_174
-494	val_494
-466	val_466
-208	val_208
 174	val_174
-396	val_396
-162	val_162
-266	val_266
-342	val_342
-0	val_0
-128	val_128
-316	val_316
-302	val_302
-438	val_438
-170	val_170
-20	val_20
-378	val_378
-92	val_92
-72	val_72
-4	val_4
-280	val_280
-208	val_208
-356	val_356
-382	val_382
-498	val_498
-386	val_386
-192	val_192
-286	val_286
+174	val_175
+174	val_175
 176	val_176
-54	val_54
-138	val_138
-216	val_216
-430	val_430
-278	val_278
 176	val_176
-318	val_318
-332	val_332
+178	val_178
+178	val_179
+178	val_179
 180	val_180
-284	val_284
-12	val_12
+182	val_183
+184	val_185
+186	val_186
+190	val_190
+192	val_192
+192	val_193
+194	val_194
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+202	val_202
+204	val_205
+206	val_207
+206	val_207
+206	val_207
+208	val_208
+208	val_208
+208	val_208
+212	val_213
+214	val_214
+216	val_216
+216	val_216
+216	val_217
+218	val_218
+222	val_222
+222	val_223
+224	val_224
+224	val_224
+224	val_225
+226	val_226
+226	val_227
+226	val_227
+226	val_227
+226	val_227
+228	val_228
+228	val_229
+230	val_230
+230	val_230
 230	val_230
-260	val_260
-404	val_404
-384	val_384
-272	val_272
-138	val_138
-84	val_84
-348	val_348
-466	val_466
-58	val_58
-8	val_8
 230	val_230
-208	val_208
-348	val_348
-24	val_24
-172	val_172
-42	val_42
-158	val_158
-496	val_496
-0	val_0
-322	val_322
-468	val_468
-454	val_454
-100	val_100
-298	val_298
-418	val_418
-96	val_96
-26	val_26
 230	val_230
-120	val_120
-404	val_404
-436	val_436
-156	val_156
-468	val_468
-308	val_308
-196	val_196
-288	val_288
-98	val_98
-282	val_282
-318	val_318
-318	val_318
-470	val_470
-316	val_316
-0	val_0
-490	val_490
-364	val_364
-118	val_118
-134	val_134
-282	val_282
-138	val_138
 238	val_238
-118	val_118
-72	val_72
-90	val_90
-10	val_10
-306	val_306
-224	val_224
+238	val_238
+238	val_239
+240	val_241
 242	val_242
-392	val_392
-272	val_272
 242	val_242
-452	val_452
-226	val_226
-402	val_402
-396	val_396
-58	val_58
-336	val_336
-168	val_168
-34	val_34
-472	val_472
-322	val_322
-498	val_498
-160	val_160
-42	val_42
-430	val_430
-458	val_458
-78	val_78
-76	val_76
-492	val_492
-218	val_218
-228	val_228
-138	val_138
-30	val_30
-64	val_64
-468	val_468
-76	val_76
-74	val_74
+242	val_243
+244	val_244
+244	val_245
+244	val_245
+244	val_245
+246	val_247
+246	val_247
+248	val_248
+248	val_249
+252	val_252
+252	val_253
+254	val_255
+256	val_256
+256	val_256
+256	val_257
+258	val_258
+258	val_259
+260	val_260
+260	val_261
+260	val_261
+262	val_262
+262	val_263
+262	val_263
+264	val_265
+264	val_265
+266	val_266
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+274	val_274
+274	val_275
+276	val_277
+278	val_278
+278	val_278
+278	val_279
+280	val_280
+280	val_280
+282	val_282
+282	val_282
+284	val_284
+284	val_285
+284	val_285
+286	val_286
+286	val_287
+288	val_288
+288	val_288
+292	val_292
+292	val_293
+292	val_293
+296	val_296
+296	val_297
+298	val_298
+298	val_298
+298	val_298
+300	val_301
+300	val_301
+302	val_302
+302	val_303
+304	val_305
+306	val_306
+306	val_307
+308	val_308
+308	val_309
+308	val_309
+310	val_310
+310	val_311
+310	val_311
+310	val_311
+314	val_315
+316	val_316
+316	val_316
+316	val_316
+318	val_318
+318	val_318
+318	val_318
+318	val_319
+322	val_322
+322	val_322
+322	val_323
+324	val_325
+326	val_327
+328	val_329
+328	val_329
+330	val_331
+332	val_332
+334	val_335
+336	val_336
+336	val_337
+338	val_338
+338	val_339
+340	val_341
 342	val_342
-230	val_230
-368	val_368
-296	val_296
-216	val_216
+342	val_342
+342	val_343
 344	val_344
-274	val_274
-116	val_116
-256	val_256
-70	val_70
-480	val_480
-288	val_288
-244	val_244
-438	val_438
-128	val_128
-432	val_432
-202	val_202
-316	val_316
-280	val_280
-2	val_2
-80	val_80
-44	val_44
-104	val_104
-466	val_466
+344	val_344
+344	val_345
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_348
+348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+358	val_359
+360	val_360
+360	val_361
+362	val_362
+364	val_364
+364	val_365
 366	val_366
+368	val_368
+374	val_374
+374	val_375
+376	val_377
+378	val_378
+378	val_379
+382	val_382
+382	val_382
+382	val_383
+382	val_383
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+386	val_386
+386	val_387
+386	val_387
+388	val_389
+390	val_391
+390	val_391
+390	val_391
+392	val_392
+392	val_393
+392	val_393
+394	val_394
+396	val_396
+396	val_396
+396	val_396
+398	val_399
+400	val_400
+402	val_402
+402	val_403
+402	val_403
+402	val_403
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
 406	val_406
-190	val_190
 406	val_406
-114	val_114
-258	val_258
-90	val_90
-262	val_262
-348	val_348
+406	val_406
+406	val_406
+406	val_407
+408	val_409
+408	val_409
+410	val_411
+412	val_413
+412	val_413
+414	val_414
+414	val_414
+414	val_415
+416	val_417
+418	val_418
 424	val_424
-12	val_12
-396	val_396
-164	val_164
-454	val_454
-478	val_478
-298	val_298
-164	val_164
 424	val_424
-382	val_382
-70	val_70
-480	val_480
-24	val_24
-104	val_104
-70	val_70
+424	val_425
+426	val_427
+428	val_429
+430	val_430
+430	val_430
+430	val_430
+430	val_431
+432	val_432
+432	val_433
+436	val_436
+436	val_437
 438	val_438
-414	val_414
-200	val_200
-360	val_360
-248	val_248
+438	val_438
+438	val_438
+438	val_439
+438	val_439
+440	val_441
+440	val_441
+442	val_443
 444	val_444
-120	val_120
-230	val_230
-478	val_478
-178	val_178
-468	val_468
-310	val_310
+446	val_446
+446	val_447
+446	val_447
+448	val_448
+448	val_449
+450	val_451
+450	val_451
+452	val_452
+454	val_454
+454	val_454
+454	val_454
+454	val_455
+454	val_455
+458	val_458
+458	val_458
 460	val_460
-480	val_480
-136	val_136
-172	val_172
-214	val_214
 462	val_462
-406	val_406
-454	val_454
-384	val_384
-256	val_256
-26	val_26
-134	val_134
-384	val_384
-18	val_18
 462	val_462
+462	val_463
+466	val_466
+466	val_466
+466	val_466
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+470	val_470
+470	val_471
+472	val_472
+474	val_475
+474	val_475
+476	val_477
+476	val_477
+478	val_478
+478	val_478
+478	val_479
+478	val_479
+480	val_480
+480	val_480
+480	val_480
+480	val_481
+480	val_481
+482	val_482
+482	val_483
+484	val_484
+484	val_485
+486	val_487
+488	val_489
+490	val_490
+490	val_491
 492	val_492
-100	val_100
-298	val_298
+492	val_492
+492	val_493
+492	val_493
+494	val_494
+494	val_495
+494	val_495
+496	val_496
+496	val_497
+498	val_498
+498	val_498
 498	val_498
-146	val_146
-458	val_458
-362	val_362
-186	val_186
-348	val_348
-18	val_18
-344	val_344
-84	val_84
-28	val_28
-448	val_448
-152	val_152
-348	val_348
-194	val_194
-414	val_414
-222	val_222
-126	val_126
-90	val_90
-400	val_400
-200	val_200

http://git-wip-us.apache.org/repos/asf/hive/blob/530f2b0d/ql/src/test/results/clientpositive/spark/sample6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/sample6.q.out b/ql/src/test/results/clientpositive/spark/sample6.q.out
index 1158732..e4e80ab 100644
--- a/ql/src/test/results/clientpositive/spark/sample6.q.out
+++ b/ql/src/test/results/clientpositive/spark/sample6.q.out
@@ -168,262 +168,264 @@ POSTHOOK: Output: default@dest1
 POSTHOOK: Lineage: dest1.key SIMPLE [(srcbucket)s.FieldSchema(name:key, type:int, comment:null), ]
 POSTHOOK: Lineage: dest1.value SIMPLE [(srcbucket)s.FieldSchema(name:value, type:string, comment:null), ]
 PREHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT dest1.* FROM dest1
+order by key, value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
 #### A masked pattern was here ####
-468	val_469
-272	val_273
-448	val_449
-440	val_441
-296	val_297
-428	val_429
-356	val_357
-128	val_129
+0	val_0
+0	val_0
+0	val_0
 0	val_1
-240	val_241
-408	val_409
-476	val_477
-48	val_49
-424	val_425
-488	val_489
-128	val_129
-468	val_469
-224	val_225
-344	val_345
+0	val_1
+4	val_4
 4	val_5
-56	val_57
-304	val_305
-264	val_265
-196	val_197
-20	val_21
-492	val_493
-360	val_361
-68	val_69
+8	val_8
+8	val_9
+12	val_12
+12	val_12
+12	val_13
 16	val_17
-492	val_493
-376	val_377
-120	val_121
-132	val_133
-388	val_389
-184	val_185
-284	val_285
-352	val_353
-328	val_329
-480	val_481
-480	val_481
-392	val_393
-476	val_477
-252	val_253
-264	val_265
-48	val_49
-336	val_337
-340	val_341
-484	val_485
-260	val_261
-164	val_165
-104	val_105
-80	val_81
-140	val_141
-212	val_213
-308	val_309
-416	val_417
-364	val_365
+16	val_17
+20	val_20
 20	val_21
-52	val_53
-40	val_41
-8	val_9
-168	val_169
-384	val_385
-324	val_325
-404	val_405
-260	val_261
-328	val_329
-404	val_405
-384	val_385
-76	val_77
-116	val_117
-104	val_105
+20	val_21
+24	val_24
+24	val_24
+28	val_28
 32	val_33
-132	val_133
-192	val_193
-356	val_357
-352	val_353
+40	val_41
+40	val_41
+44	val_44
+48	val_49
+48	val_49
 52	val_53
-160	val_161
-76	val_77
-412	val_413
-16	val_17
-204	val_205
-216	val_217
-196	val_197
-12	val_13
-384	val_385
-60	val_61
 52	val_53
-404	val_405
-300	val_301
-0	val_1
-268	val_269
-392	val_393
+52	val_53
+52	val_53
+56	val_57
+60	val_61
+64	val_64
+68	val_69
+72	val_72
+72	val_72
+76	val_76
+76	val_76
+76	val_77
+76	val_77
+76	val_77
+80	val_80
+80	val_81
+84	val_84
+84	val_84
+92	val_92
+96	val_96
+100	val_100
+100	val_100
+100	val_101
+100	val_101
+104	val_104
+104	val_104
 104	val_105
-436	val_437
-156	val_157
-172	val_173
-244	val_245
-284	val_285
-164	val_165
+104	val_105
+104	val_105
+116	val_116
+116	val_117
+120	val_120
+120	val_120
+120	val_121
+128	val_128
+128	val_128
+128	val_128
+128	val_129
+128	val_129
+132	val_133
+132	val_133
+136	val_136
 136	val_137
-432	val_433
-496	val_497
+140	val_141
 144	val_145
-408	val_409
+152	val_152
+152	val_152
 152	val_153
-348	val_349
-292	val_293
-52	val_53
 152	val_153
-256	val_257
-292	val_293
-412	val_413
-40	val_41
-100	val_101
+152	val_153
+156	val_156
+156	val_157
 156	val_157
+160	val_160
+160	val_161
+164	val_164
+164	val_164
+164	val_165
+164	val_165
+168	val_168
+168	val_169
+172	val_172
+172	val_172
+172	val_173
+176	val_176
+176	val_176
+180	val_180
+184	val_185
+192	val_192
+192	val_193
+196	val_196
+196	val_197
+196	val_197
+196	val_197
+200	val_200
+200	val_200
+204	val_205
+208	val_208
+208	val_208
+208	val_208
+212	val_213
+216	val_216
+216	val_216
+216	val_217
+224	val_224
+224	val_224
+224	val_225
+228	val_228
 228	val_229
-248	val_249
+240	val_241
+244	val_244
 244	val_245
-276	val_277
-196	val_197
-440	val_441
-100	val_101
-308	val_309
-468	val_469
-152	val_153
-76	val_77
-300	val_301
 244	val_245
-484	val_484
-224	val_224
-128	val_128
-152	val_152
+244	val_245
+248	val_248
+248	val_249
 252	val_252
+252	val_253
+256	val_256
+256	val_256
+256	val_257
+260	val_260
+260	val_261
+260	val_261
+264	val_265
+264	val_265
+268	val_269
+272	val_272
+272	val_272
+272	val_273
+276	val_277
+280	val_280
+280	val_280
+284	val_284
+284	val_285
+284	val_285
+288	val_288
+288	val_288
 292	val_292
-208	val_208
-396	val_396
-0	val_0
-128	val_128
+292	val_293
+292	val_293
+296	val_296
+296	val_297
+300	val_301
+300	val_301
+304	val_305
+308	val_308
+308	val_309
+308	val_309
 316	val_316
-20	val_20
-92	val_92
-72	val_72
-4	val_4
-280	val_280
-208	val_208
-356	val_356
-192	val_192
-176	val_176
-216	val_216
-176	val_176
+316	val_316
+316	val_316
+324	val_325
+328	val_329
+328	val_329
 332	val_332
-180	val_180
-284	val_284
-12	val_12
-260	val_260
-404	val_404
-384	val_384
-272	val_272
-84	val_84
+336	val_336
+336	val_337
+340	val_341
+344	val_344
+344	val_344
+344	val_345
 348	val_348
-8	val_8
-208	val_208
 348	val_348
-24	val_24
-172	val_172
-496	val_496
-0	val_0
-468	val_468
-100	val_100
-96	val_96
-120	val_120
-404	val_404
-436	val_436
-156	val_156
-468	val_468
-308	val_308
-196	val_196
-288	val_288
-316	val_316
-0	val_0
+348	val_348
+348	val_348
+348	val_348
+348	val_349
+352	val_353
+352	val_353
+356	val_356
+356	val_357
+356	val_357
+360	val_360
+360	val_361
 364	val_364
-72	val_72
-224	val_224
+364	val_365
+368	val_368
+376	val_377
+384	val_384
+384	val_384
+384	val_384
+384	val_385
+384	val_385
+384	val_385
+388	val_389
 392	val_392
-272	val_272
-452	val_452
+392	val_393
+392	val_393
 396	val_396
-336	val_336
-168	val_168
-472	val_472
-160	val_160
-76	val_76
-492	val_492
-228	val_228
-64	val_64
-468	val_468
-76	val_76
-368	val_368
-296	val_296
-216	val_216
-344	val_344
-116	val_116
-256	val_256
-480	val_480
-288	val_288
-244	val_244
-128	val_128
-432	val_432
-316	val_316
-280	val_280
-80	val_80
-44	val_44
-104	val_104
-348	val_348
-424	val_424
-12	val_12
 396	val_396
-164	val_164
-164	val_164
+396	val_396
+400	val_400
+404	val_404
+404	val_404
+404	val_405
+404	val_405
+404	val_405
+408	val_409
+408	val_409
+412	val_413
+412	val_413
+416	val_417
 424	val_424
-480	val_480
-24	val_24
-104	val_104
-200	val_200
-360	val_360
-248	val_248
+424	val_424
+424	val_425
+428	val_429
+432	val_432
+432	val_433
+436	val_436
+436	val_437
+440	val_441
+440	val_441
 444	val_444
-120	val_120
-468	val_468
+448	val_448
+448	val_449
+452	val_452
 460	val_460
+468	val_468
+468	val_468
+468	val_468
+468	val_468
+468	val_469
+468	val_469
+468	val_469
+472	val_472
+476	val_477
+476	val_477
 480	val_480
-136	val_136
-172	val_172
-384	val_384
-256	val_256
-384	val_384
+480	val_480
+480	val_480
+480	val_481
+480	val_481
+484	val_484
+484	val_485
+488	val_489
 492	val_492
-100	val_100
-348	val_348
-344	val_344
-84	val_84
-28	val_28
-448	val_448
-152	val_152
-348	val_348
-400	val_400
-200	val_200
+492	val_492
+492	val_493
+492	val_493
+496	val_496
+496	val_497
 PREHOOK: query: EXPLAIN EXTENDED SELECT s.* FROM srcbucket TABLESAMPLE (BUCKET 4 OUT OF 4 on key) s
 ORDER BY key, value
 PREHOOK: type: QUERY


Mime
View raw message