mihaibudiu commented on code in PR #4986:
URL: https://github.com/apache/calcite/pull/4986#discussion_r3350378825
##########
core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java:
##########
@@ -371,16 +371,24 @@ public static SqlTimeTzLiteral parseTimeTzLiteral(
final String timeZone = s.substring(lastSpace + 1);
final String time = s.substring(0, lastSpace);
- final TimeZone tz = TimeZone.getTimeZone(timeZone);
- if (tz != null) {
+ try {
+ ZoneId zoneId = ZoneId.of(timeZone);
+ TimeZone tz = TimeZone.getTimeZone(zoneId);
pt =
DateTimeUtils.parsePrecisionDateTimeLiteral(time,
Format.get().time, tz, -1);
+ } catch (DateTimeException e) {
+ String message = e.getMessage();
+ if (message == null) {
+ message = "Error parsing TIME ZONE";
Review Comment:
I actually think this is fine, since this is how the SQL type is spelled
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]