You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "tjbanghart (via GitHub)" <gi...@apache.org> on 2023/04/21 19:53:02 UTC

[GitHub] [calcite] tjbanghart commented on a diff in pull request #3132: [CALCITE-5543] Implement BigQuery functions for parsing DATE, TIME, TIMESTAMP, DATETIME

tjbanghart commented on code in PR #3132:
URL: https://github.com/apache/calcite/pull/3132#discussion_r1174116807


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -2650,6 +2651,63 @@ public static String formatTime(DataContext ctx, String fmtString, int time) {
     return internalFormatDatetime(fmtString, internalToTime(time));
   }
 
+  private static String parseDatetimePattern(String fmtString) {
+    StringBuilder sb = new StringBuilder();
+    List<FormatElement> elements = FormatModels.BIG_QUERY.parse(fmtString);
+    elements.forEach(ele -> ele.toPattern(sb));
+    return sb.toString();
+  }
+
+  private static Date interalParseDatetime(String fmtString, String datetime) {
+    return interalParseDatetime(fmtString, datetime, DateTimeUtils.DEFAULT_ZONE);
+  }
+

Review Comment:
   Yikes, thank you!



-- 
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: commits-unsubscribe@calcite.apache.org

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