Removed bins_start as query output

This commit is contained in:
Daniel García Aubert 2017-06-05 14:17:50 +02:00
parent 32eeb57fce
commit 6ff3b33cde

View File

@ -155,7 +155,6 @@ var dateHistogramQueryTpl = dot.template([
' bins_number',
' )) - 1',
' END AS bin,',
' date_part(\'epoch\', start_date)::numeric AS bins_start,',
' min(date_part(',
' \'epoch\', ',
' date_trunc(\'{{=it._aggregation}}\', d AT TIME ZONE \'{{=it._timezone}}\'',
@ -385,7 +384,11 @@ Histogram.prototype.format = function(result, override) {
width = firstRow.bin_width || width;
avg = firstRow.avg_val;
nulls = firstRow.nulls_count;
binsStart = override.hasOwnProperty('start') ? getBinStart(override) : firstRow.min;
binsStart = override.hasOwnProperty('start') ?
getBinStart(override) :
firstRow.hasOwnProperty('timestamp') ?
firstRow.timestamp :
firstRow.min;
buckets = result.rows.map(function(row) {
return _.omit(row, 'bins_number', 'bin_width', 'nulls_count', 'avg_val', 'bins_start');