facebookincubator / velox

A C++ vectorized database acceleration library aimed to optimizing query engines and data processing systems.
https://velox-lib.io/
Apache License 2.0
3.28k stars 1.09k forks source link

format_datetime fails with +00:00 not found in timezone database #10101

Open mbasmanova opened 1 month ago

mbasmanova commented 1 month ago

Bug description

TEST_F(DateTimeFunctionsTest, xxx) {
  auto r = evaluateOnce<std::string>(
      "format_datetime(from_unixtime(0.0, 'UTC'), 'yyyy-MM-dd HH:mm:ss')",
      std::optional(123));

  ASSERT_TRUE(r.has_value());
  LOG(ERROR) << r.value();
}

[ RUN      ] DateTimeFunctionsTest.xxx

terminate called after throwing an instance of 'facebook::velox::VeloxUserError'
  what():  Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: +00:00 not found in timezone database
Retriable: False
Context: Top-level Expression: format_datetime(0:TIMESTAMP WITH TIME ZONE, yyyy-MM-dd HH:mm:ss:VARCHAR)

Similar errors:

They come from date::locate_zone("+00:00").

CC: @pedroerp @amitkdutta

System information

n/a

Relevant logs

No response

PHILO-HE commented 1 month ago

FYI. Quote: _"date::locate_zone() only recognizes IANA time zone names. Here is a list of the IANA time zone names: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"_

Source https://github.com/HowardHinnant/date/issues/823#issuecomment-2059351689.

mbasmanova commented 2 weeks ago

@pedroerp Pedro, any update on this?

pedroerp commented 1 week ago

@pedroerp Pedro, any update on this?

I haven't had the time to start on this yet. Unless anyone has bandwidth to take this first, my plan is to start early next week.