meredith620 commented on PR #14531: URL: https://github.com/apache/doris/pull/14531#issuecomment-1333873977
> I add a session variable 'enable_unicode_name_support', and use it to switch regex like this in class FeNameFormat > > ```java > public static String getLabelRegex() { > if (ConnectContext.get().getSessionVariable().isEnableUnicodeNameSupport()) { > return UNICODE_LABEL_REGEX; > } else { > return LABEL_REGEX; > } > } > ``` > > Then I find one section in [TimeUtils.java](https://github.com/apache/doris/blob/1.1.5-rc01/fe/fe-core/src/main/java/org/apache/doris/common/util/TimeUtils.java#L123) > > ```java > public static TimeZone getTimeZone() { > String timezone; > if (ConnectContext.get() != null) { > timezone = ConnectContext.get().getSessionVariable().getTimeZone(); > } else { > timezone = VariableMgr.getDefaultSessionVariable().getTimeZone(); > } > return TimeZone.getTimeZone(ZoneId.of(timezone, timeZoneAliasMap)); > } > ``` > > @yiguolei My question is when should I check if `ConnectContext.get()` returns null and use `VariableMgr.getDefaultSessionVariable()` ? I see it fails unittest, maybe I should use the same method like TimeUtils.java -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org