From a0c24d132ebecfcd9df1a873e79a3d1f7a1d5ae8 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Thu, 14 Dec 2017 18:43:59 +0000 Subject: [PATCH] Use source query as attribute instead of function --- lib/cartodb/models/aggregation/aggregation-query.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/models/aggregation/aggregation-query.js b/lib/cartodb/models/aggregation/aggregation-query.js index b42b1c57..a43aead0 100644 --- a/lib/cartodb/models/aggregation/aggregation-query.js +++ b/lib/cartodb/models/aggregation/aggregation-query.js @@ -151,7 +151,7 @@ const aggregationQueryTemplates = { Floor(ST_Y(_cdb_query.the_geom_webmercator)/_cdb_params.res)::int AS _cdb_gy ${dimensionDefs(ctx)} ${aggregateColumnDefs(ctx)} - FROM (${ctx.sourceQuery(ctx)}) _cdb_query, _cdb_params + FROM (${ctx.sourceQuery}) _cdb_query, _cdb_params WHERE the_geom_webmercator && _cdb_params.bbox GROUP BY _cdb_gx, _cdb_gy ${dimensionNames} ) @@ -172,7 +172,7 @@ const aggregationQueryTemplates = { MIN(cartodb_id) AS cartodb_id ${dimensionDefs(ctx)} ${aggregateColumnDefs(ctx)} - FROM (${ctx.sourceQuery(ctx)}) _cdb_query, _cdb_params + FROM (${ctx.sourceQuery}) _cdb_query, _cdb_params WHERE _cdb_query.the_geom_webmercator && _cdb_params.bbox GROUP BY Floor(ST_X(_cdb_query.the_geom_webmercator)/_cdb_params.res), @@ -184,7 +184,7 @@ const aggregationQueryTemplates = { ${dimensionNames(ctx)} ${aggregateColumnNames(ctx)} FROM - _cdb_clusters INNER JOIN (${ctx.sourceQuery(ctx)}) _cdb_query + _cdb_clusters INNER JOIN (${ctx.sourceQuery}) _cdb_query ON (_cdb_clusters.cartodb_id = _cdb_query.cartodb_id) ` };