okumin commented on code in PR #5837:
URL: https://github.com/apache/hive/pull/5837#discussion_r2120932185
##########
ql/src/test/queries/clientpositive/udf_dayofweek_with_tz.q:
##########
@@ -0,0 +1,31 @@
+--! qt:timezone:Asia/Shanghai
+
+CREATE EXTERNAL TABLE dayOfWeek_test(
+`fund_code` string,
+`test_date` string
+);
+
+INSERT INTO dayOfWeek_test(fund_code,test_date)
+values('SEC016210079','2023-04-13');
+
+set hive.vectorized.execution.enabled=false;
+
+SELECT fund_code,
+ test_date,
+ dayofweek(test_date) AS SR,
+ CASE
+ WHEN dayofweek(test_date) = 1 THEN 7
+ ELSE dayofweek(test_date) - 1
+ END AS week_day
+FROM dayOfWeek_test;
+
+set hive.vectorized.execution.enabled=true;
+
+SELECT fund_code,
+ test_date,
+ dayofweek(test_date) AS SR,
+ CASE
+ WHEN dayofweek(test_date) = 1 THEN 7
+ ELSE dayofweek(test_date) - 1
+ END AS week_day
+FROM dayOfWeek_test;
Review Comment:
Is it expected that the result sets are identical on my machine without this
patch?
```
SEC016210079 2023-04-13 5 4
PREHOOK: query: SELECT fund_code,
test_date,
dayofweek(test_date) AS SR,
CASE
WHEN dayofweek(test_date) = 1 THEN 7
ELSE dayofweek(test_date) - 1
END AS week_day
FROM dayOfWeek_test
PREHOOK: type: QUERY
PREHOOK: Input: default@dayofweek_test
#### A masked pattern was here ####
POSTHOOK: query: SELECT fund_code,
test_date,
dayofweek(test_date) AS SR,
CASE
WHEN dayofweek(test_date) = 1 THEN 7
ELSE dayofweek(test_date) - 1
END AS week_day
FROM dayOfWeek_test
POSTHOOK: type: QUERY
POSTHOOK: Input: default@dayofweek_test
#### A masked pattern was here ####
SEC016210079 2023-04-13 5 4
```
--
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]