[ https://issues.apache.org/jira/browse/HIVE-24810?focusedWorklogId=601187&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-601187 ]
ASF GitHub Bot logged work on HIVE-24810: ----------------------------------------- Author: ASF GitHub Bot Created on: 24/May/21 13:28 Start Date: 24/May/21 13:28 Worklog Time Spent: 10m Work Description: pgaref commented on a change in pull request #2002: URL: https://github.com/apache/hive/pull/2002#discussion_r637943868 ########## 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: Hey @belugabehr -- it was actually the fall through that confused me, I see what you are doing now In the original code it was part of an else if statement taking care of both. -- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 601187) Time Spent: 1h 40m (was: 1.5h) > 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 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)