[
https://issues.apache.org/jira/browse/HIVE-24810?focusedWorklogId=601185&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-601185
]
ASF GitHub Bot logged work on HIVE-24810:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/May/21 13:22
Start Date: 24/May/21 13:22
Worklog Time Spent: 10m
Work Description: belugabehr commented on a change in pull request #2002:
URL: https://github.com/apache/hive/pull/2002#discussion_r637940606
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/TruncDateFromTimestamp.java
##########
@@ -147,18 +148,29 @@ protected void truncDate(ColumnVector inV,
BytesColumnVector outV, int i) {
}
protected void processDate(BytesColumnVector outV, int i, Date date) {
- if ("MONTH".equals(fmt) || "MON".equals(fmt) || "MM".equals(fmt)) {
+ switch (fmt) {
+ case "YEAR":
+ case "YYYY":
+ case "YY":
+ date.setMonth(1);
Review comment:
@pgaref Thanks so much for taking a look. I'm not sure however what
your comment means.
The year stuff get `Month=1` and `dayOfMonth=1`. The Month stuff gets only
`dayOfMonth=1`.
This switch statement "falls through" to cover both outcomes.
--
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 601185)
Time Spent: 1h 20m (was: 1h 10m)
> Use JDK 8 String Switch in TruncDateFromTimestamp
> -------------------------------------------------
>
> Key: HIVE-24810
> URL: https://issues.apache.org/jira/browse/HIVE-24810
> Project: Hive
> Issue Type: Improvement
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)