[ https://issues.apache.org/jira/browse/IMPALA-5563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Attila Jeges resolved IMPALA-5563. ---------------------------------- Resolution: Fixed Fix Version/s: Impala 3.1.0 Fixing IMPALA-3307 fixed this issue as well. > Timezone lookup may be ambiguous > -------------------------------- > > Key: IMPALA-5563 > URL: https://issues.apache.org/jira/browse/IMPALA-5563 > Project: IMPALA > Issue Type: Bug > Components: Backend > Affects Versions: Impala 2.0 > Reporter: Matthew Jacobs > Assignee: Attila Jeges > Priority: Major > Labels: timezone > Fix For: Impala 3.1.0 > > > When using functions like {{to_utc_timestamp}} that take a string timezone > parameter, if the timezone is not a 'region specifier' [1] (i.e. a key into > the timezone database entries), then Impala attempts to match the string > parameter against a number of other properties of the timezones in the > database [2]: > * a zone's std abbreviation > * a zone's std full name > * a zone's dst abbreviation > * a zone's dst full name > {code} > time_zone_ptr TimezoneDatabase::FindTimezone( > const string& tz, const TimestampValue& tv, bool tv_in_utc) { > ... > // See if they specified a zone id > time_zone_ptr tzp = tz_database_.time_zone_from_region(tz); > if (tzp != NULL) return tzp; > for (vector<string>::const_iterator iter = tz_region_list_.begin(); > iter != tz_region_list_.end(); ++iter) { > time_zone_ptr tzp = tz_database_.time_zone_from_region(*iter); > DCHECK(tzp != NULL); > if (tzp->dst_zone_abbrev() == tz) return tzp; > if (tzp->std_zone_abbrev() == tz) return tzp; > if (tzp->dst_zone_name() == tz) return tzp; > if (tzp->std_zone_name() == tz) return tzp; > } > return time_zone_ptr(); > } > {code} > This can result in ambiguous zones being used because the properties listed > above are not unique, e.g. > {code} > mj@mj-desktop:~/dev/Impala$ grep CEST be/src/exprs/timezone_db.cc > \"Africa/Ceuta\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Antarctica/Troll\",\"UTC\",\"Coordinated Universal > Time\",\"CEST\",\"Central European Summer > Time\",\"+00:00:00\",\"+02:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Arctic/Longyearbyen\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Atlantic/Jan_Mayen\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"CET\",\"CET\",\"Central European Time\",\"CEST\",\"Central European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+02:00:00\",\"-1;0;10\",\"+02:00:00\"\n\ > \"ECT\",\"CET\",\"Central European Time\",\"CEST\",\"Central European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Amsterdam\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Andorra\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Belgrade\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Berlin\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Bratislava\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Brussels\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Budapest\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Busingen\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Copenhagen\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Gibraltar\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Ljubljana\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Luxembourg\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Madrid\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Malta\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Monaco\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Oslo\",\"CET\",\"Central European Time\",\"CEST\",\"Central European > Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Paris\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Podgorica\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Prague\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Rome\",\"CET\",\"Central European Time\",\"CEST\",\"Central European > Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/San_Marino\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Sarajevo\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Skopje\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Stockholm\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Tirane\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Vaduz\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Vatican\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Vienna\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Warsaw\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Zagreb\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Europe/Zurich\",\"CET\",\"Central European Time\",\"CEST\",\"Central > European Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > \"Poland\",\"CET\",\"Central European Time\",\"CEST\",\"Central European > Summer > Time\",\"+01:00:00\",\"+01:00:00\",\"-1;0;3\",\"+01:00:00\",\"-1;0;10\",\"+01:00:00\"\n\ > {code} > Based on the code, CEST may match a zone with many different GMT offsets or > DST adjustments/dates. Depending on the order in which the list of zones > happens to be iterated, the results will be different. > 1: http://www.boost.org/doc/libs/1_64_0/doc/html/date_time/local_time.html > 2: > https://github.com/apache/incubator-impala/blob/2.9.0/be/src/exprs/timezone_db.cc#L45 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org For additional commands, e-mail: issues-all-h...@impala.apache.org