asolimando commented on a change in pull request #2979:
URL: https://github.com/apache/hive/pull/2979#discussion_r795879275
##########
File path: ql/src/test/queries/clientpositive/order_null2.q
##########
@@ -0,0 +1,70 @@
+create table test1
+(
+ a string,
+ b timestamp,
+ c timestamp
+);
+
+INSERT INTO TABLE test1 VALUES
+('John Doe', '1990-05-10 00:00:00.0', '2022-01-10 00:00:00.0'),
+('John Doe', '1990-05-10 00:00:00.0', '2021-12-10 00:00:00.0'),
+('John Doe', '1990-05-10 00:00:00.0', '2021-11-10 00:00:00.0'),
+('John Doe', '1990-05-10 00:00:00.0', '2021-10-10 00:00:00.0'),
+('John Doe', '1990-05-10 00:00:00.0', '2021-09-10 00:00:00.0'),
+('John Doe', '1987-05-10 00:00:00.0', '2022-01-10 00:00:00.0'),
+('John Doe', '1987-05-10 00:00:00.0', '2021-12-10 00:00:00.0'),
+('John Doe', '1987-05-10 00:00:00.0', '2021-11-10 00:00:00.0'),
+('John Doe', '1987-05-10 00:00:00.0', '2021-10-10 00:00:00.0'),
+('John Doe', '1987-05-10 00:00:00.0', null);
+
+-- hive.default.nulls.last is true by default, it sets NULLS_FIRST for DESC
+EXPLAIN AST
+SELECT a, b, c, row_number() OVER (PARTITION BY a, b ORDER BY b DESC, c DESC)
+FROM test1;
+
+EXPLAIN
+SELECT a, b, c, row_number() OVER (PARTITION BY a, b ORDER BY b DESC, c DESC)
+FROM test1;
+
+SELECT a, b, c, row_number() OVER (PARTITION BY a, b ORDER BY b DESC, c DESC)
+FROM test1;
Review comment:
To verify the final behaviour yes, the explains are mostly useful to see
immediately if the problem happens in the parser (`EXPLAIN AST`) or later on
during query planning or at translation time (`EXPLAIN`).
Finally, also execution time could break the property, in that case you
would have both explains as expected but wrong results.
I think it will save a lot of investigation time to keep all of them, if
something will break, but I am good with removing some if you think it's best.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]