mihaibudiu commented on code in PR #3569:
URL: https://github.com/apache/calcite/pull/3569#discussion_r1436583927


##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java:
##########
@@ -309,7 +314,10 @@ public enum SqlTypeName {
    * matches the given name, or throws {@link IllegalArgumentException}; never
    * returns null. */
   public static SqlTypeName lookup(String tag) {
-    String tag2 = tag.replace(' ', '_');
+    // Special handling for TIME WITH TIME ZONE and
+    // TIMESTAMP WITH TIME ZONE, whose names are TIME_TZ and TIMESTAMP_TZ
+    final String tag1 = tag.replace("WITH TIME ZONE", "TZ");

Review Comment:
   Since this is not performance-critical I think I prefer the version I wrote, 
because it is obvious what it does. To understand your version you have to be 
an expert in regular expressions, and most people aren't. Your version seems to 
be case-insensitive, but I think that this string will always be uppercase, 
since it is inserted here by the parser. I will document this behavior. 



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

Reply via email to