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](https://github.com/apache/hive/pull/2002/files#diff-9a5478214c2ce29fdb4ea633ae8c9adc6a163b44fc987458686fc82cd02d3e22L160).
   




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to