walterddr commented on a change in pull request #8324: [FLINK-11921][table] 
Upgrade to calcite 1.19
URL: https://github.com/apache/flink/pull/8324#discussion_r284344081
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java
 ##########
 @@ -783,6 +840,30 @@ private static long firstMondayOfFirstWeek(int year) {
                return janFirst + (11 - janFirstDow) % 7 - 3;
        }
 
+       /** Returns the ISO-8601 week number based on year, month, day.
+        * Per ISO-8601 it is the Monday of the week that contains Jan 4,
+        * or equivalently, it is a Monday between Dec 29 and Jan 4.
+        * Sometimes it is in the year before the given year, sometimes after. 
*/
+       private static int getIso8601WeekNumber(int julian, int year, int 
month, int day) {
+               long fmofw = firstMondayOfFirstWeek(year);
+               if (month == 12 && day > 28) {
+                       if (31 - day + 4 > 7 - ((int) floorMod(julian, 7) + 1)
 
 Review comment:
   these lines are copied from avatica 1.14.0 release

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


With regards,
Apache Git Services

Reply via email to