Hi, I have a question about `DATETIMECONVERT` . It...
# troubleshooting
q
Hi, I have a question about
DATETIMECONVERT
. It mentions it buckets the time based on the given time granularity, but what is the start of the first bucket? e.g. when running this query:
Copy code
SELECT DATETIMECONVERT(time_col, '1:MILLISECONDS:EPOCH', '1:SECONDS:EPOCH', '30:DAYS') as new_time_col, COUNT(id) FROM table WHERE (time_col BETWEEN <epoch_second of 7/16> AND <epoch_second of 9/16>) AND GROUP BY new_time_col ORDER BY new_time_col
It returns 3 buckets for: 7/1, 7/31 and 8/30. So I wonder how is this being calculated?
For a bit of more context, we are trying to bucket our data with size of 30-day bucket to categorize their age.
Same result using
Copy code
DATETIMECONVERT(time_col, '1:MILLISECONDS:EPOCH', '1:SECONDS:EPOCH', '720:HOURS')
j
The start of the first bucket is Unix epoch time, and we use millis since epoch to calculate the time bucket
q
ah, I see. thanks!
@Lakshmanan Velusamy