You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2022/09/17 16:48:39 UTC

[GitHub] [phoenix] richardantal commented on a diff in pull request #1501: PHOENIX-5422 Use Java8 DateTime APIs instead of joda-time APIs

richardantal commented on code in PR #1501:
URL: https://github.com/apache/phoenix/pull/1501#discussion_r973605680


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/DateTimeIT.java:
##########
@@ -577,7 +577,7 @@ public void testYearFunctionDate() throws SQLException {
 
         assertEquals(2006, callYearFunction("\"YEAR\"(TO_DATE('2006-12-13'))"));
 
-        assertEquals(2015, callYearFunction("\"YEAR\"(TO_DATE('2015-W05'))"));
+        assertEquals(2015, callYearFunction("\"YEAR\"(TO_DATE('2015-W05-1'))"));

Review Comment:
   Yes, Joda time supports weird date formats as well.
   2015-W05-1 means the fifth week of 2015 and One digit for the day-of-week. The value run from Monday (1) to Sunday (7). I guess joda time defaulted the day value to 1.
   I added a separate ISO_WEEK_DATE_TIME_FORMATTER to parse dates like this. 



-- 
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: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org