diff --git a/lib/cartodb/models/aggregation/aggregation-mapconfig.js b/lib/cartodb/models/aggregation/aggregation-mapconfig.js index d3666897..548f95d3 100644 --- a/lib/cartodb/models/aggregation/aggregation-mapconfig.js +++ b/lib/cartodb/models/aggregation/aggregation-mapconfig.js @@ -171,6 +171,8 @@ module.exports = class AggregationMapConfig extends MapConfig { _getLayerAggregationRequiredColumns (index) { const { columns, dimensions } = this.getAggregation(index); + let finalColumns = ['cartodb_id', '_cdb_feature_count']; + let aggregatedColumns = []; if (columns) { aggregatedColumns = Object.keys(columns); @@ -181,7 +183,7 @@ module.exports = class AggregationMapConfig extends MapConfig { dimensionsColumns = Object.keys(dimensions); } - return removeDuplicates(aggregatedColumns.concat(dimensionsColumns)); + return removeDuplicates(finalColumns.concat(aggregatedColumns).concat(dimensionsColumns)); } doesLayerReachThreshold(index, featureCount) {