You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/06/17 03:55:42 UTC
[GitHub] [hive] kasakrisz opened a new pull request #1131: HIVE-23706: Fix nulls first sorting behavior
kasakrisz opened a new pull request #1131:
URL: https://github.com/apache/hive/pull/1131
Testing done:
```
mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=order_null.q -pl itests/qtest -Pitests
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] kasakrisz commented on a change in pull request #1131: HIVE-23706: Fix nulls first sorting behavior
Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #1131:
URL: https://github.com/apache/hive/pull/1131#discussion_r441503698
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -116,12 +116,12 @@ POSTHOOK: query: SELECT x.* FROM src_null_n1 x ORDER BY b desc, a asc
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
-2 B
-1 A
-2 A
2 NULL
3 NULL
NULL NULL
+2 B
+1 A
+2 A
Review comment:
Not sure about how up-to-date that document is but as far as I know we want nulls last as the default for asc and nulls first for desc.
It can be controlled by the setting `hive.default.nulls.last`. Default value is `true`.
I also run these queries with Postgres and got the same results as with this patch.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] kasakrisz commented on a change in pull request #1131: HIVE-23706: Fix nulls first sorting behavior
Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #1131:
URL: https://github.com/apache/hive/pull/1131#discussion_r441520582
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -116,12 +116,12 @@ POSTHOOK: query: SELECT x.* FROM src_null_n1 x ORDER BY b desc, a asc
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
-2 B
-1 A
-2 A
2 NULL
3 NULL
NULL NULL
+2 B
+1 A
+2 A
Review comment:
I agree that description is confusing I changed accordingly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak commented on a change in pull request #1131: HIVE-23706: Fix nulls first sorting behavior
Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #1131:
URL: https://github.com/apache/hive/pull/1131#discussion_r441509021
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -116,12 +116,12 @@ POSTHOOK: query: SELECT x.* FROM src_null_n1 x ORDER BY b desc, a asc
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
-2 B
-1 A
-2 A
2 NULL
3 NULL
NULL NULL
+2 B
+1 A
+2 A
Review comment:
OK, now I understand better, thanks for the clarification.
The `hive.default.nulls.last` is a bit confusing. From the name and description I get the impression that NULLS LAST is the default behavior for both ASC and DESC and apparently it is not the case either.
Yes the new results are in sync with Postgres since the latter uses the [semantics that you mentioned](https://www.postgresql.org/docs/12/queries-order.html). Note that this is not a rule from every DBMS.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] kasakrisz merged pull request #1131: HIVE-23706: Fix nulls first sorting behavior
Posted by GitBox <gi...@apache.org>.
kasakrisz merged pull request #1131:
URL: https://github.com/apache/hive/pull/1131
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak commented on a change in pull request #1131: HIVE-23706: Fix nulls first sorting behavior
Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #1131:
URL: https://github.com/apache/hive/pull/1131#discussion_r441439599
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -116,12 +116,12 @@ POSTHOOK: query: SELECT x.* FROM src_null_n1 x ORDER BY b desc, a asc
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
-2 B
-1 A
-2 A
2 NULL
3 NULL
NULL NULL
+2 B
+1 A
+2 A
Review comment:
The result that I would expect is:
```
2 B
1 A
2 A
NULL NULL
2 NULL
3 NULL
```
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -187,9 +187,9 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
1 A
+2 NULL
2 B
2 A
-2 NULL
3 NULL
NULL NULL
Review comment:
I think that the old result was correct.
##########
File path: ql/src/test/results/clientpositive/llap/order_null.q.out
##########
@@ -88,12 +88,12 @@ POSTHOOK: query: SELECT x.* FROM src_null_n1 x ORDER BY a desc
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src_null_n1
#### A masked pattern was here ####
+NULL NULL
3 NULL
2 NULL
2 A
2 B
1 A
-NULL NULL
Review comment:
I think that the old result was correct.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org