Description
Looks like date_trunc_str is broken in 7.1.0. Not sure when was introduced.
on 7.1.0-2434, wrong result:
cbq> SELECT DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'day') as day, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'week') as week, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'month') as month, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'year') as year; |
{
|
"requestID": "e4fff982-3625-4609-bd7a-82961a172d6e", |
"signature": { |
"day": "string", |
"month": "string", |
"week": "string", |
"year": "string" |
},
|
"results": [ |
{
|
"day": "0001-01-01T00:00:00Z", |
"month": "0001-01-01T00:00:00Z", |
"week": "0000-12-31T00:00:00Z", |
"year": "0001-01-01T00:00:00Z" |
}
|
on 7.1.0-1009, works as expected:
cbq> SELECT DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'day') as day, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'week') as week, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'month') as month, DATE_TRUNC_STR('2016-05-18T03:59:00Z', 'year') as year; |
{
|
"requestID": "2eed035d-44be-4075-9029-3658869bd43b", |
"signature": { |
"day": "string", |
"month": "string", |
"week": "string", |
"year": "string" |
},
|
"results": [ |
{
|
"day": "2016-05-18T00:00:00Z", |
"month": "2016-05-01T00:00:00Z", |
"week": "2016-05-15T03:59:00Z", |
"year": "2016-01-01T00:00:00Z" |
}
|
],
|
"status": "success", |
"metrics": { |
"elapsedTime": "3.346546ms", |
"executionTime": "3.044645ms", |
"resultCount": 1, |
"resultSize": 166, |
"serviceLoad": 6 |
}
|
}
|
|
Attachments
Issue Links
- relates to
-
MB-56164 Analytics DATE_TRUNC_STR returns null for WEEK, DAY_OF_WEEK, DAY_OF_YEAR, TIMEZONE, TIMEZONE_HOUR, TIMEZONE_MINUTE
- Open