Cast histogram width bucket to timestamp

This commit is contained in:
Ivan Malagon 2017-06-19 12:47:08 +02:00
parent 77cb3dbbdc
commit 6bfedef7eb

View File

@ -155,7 +155,7 @@ var dateHistogramQueryTpl = dot.template([
' CASE WHEN min_val = max_val',
' THEN 0',
' ELSE GREATEST(1, LEAST(',
' WIDTH_BUCKET({{=it._column}} AT TIME ZONE \'{{=it._timezone}}\', bins_array),',
' WIDTH_BUCKET({{=it._column}}::timestamp AT TIME ZONE \'{{=it._timezone}}\', bins_array),',
' bins_number',
' )) - 1',
' END AS bin,',