Impala SQL - 如何将时间戳截断为日?

Impala SQL - How to Truncate Timestamp to Day?

使用 Cloudera 的 Impala SQL,有没有办法按天截断时间戳?

即来自:

2015-05-01 01:23:45 -> 2015-05-01 00:00:00
2015-05-01 12:34:56 -> 2015-05-01 00:00:00
2015-05-01 23:45:59 -> 2015-05-01 00:00:00

默认的 TRUNC 选项似乎只启用周或小时,而不启用日...

根据我对 tests, you should be able to pass DDD, DD, or J to TRUNC to get this behavior. I agree that the docs are not clear on this point though--I've filed an issue 的阅读,整理了文档。