From d338b5ca3732030f9587efb0af8bec1590e468b8 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Tue, 21 Aug 2018 12:55:30 +0200 Subject: [PATCH] Fix column stats to support spaces in names This complements changes in #1020 --- lib/cartodb/backends/layer-stats/mapnik-layer-stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js index 39286f79..85eeecb2 100644 --- a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js +++ b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js @@ -148,7 +148,7 @@ function _columnStats(ctx, columns) { Object.keys(columns).forEach(name => { aggr = aggr.concat( columnAggregations(columns[name]) - .map(fn => `${fn}(${name}) AS ${name}_${fn}`) + .map(fn => `${fn}("${name}") AS "${name}_${fn}"`) ); if (columns[name].type === 'string') { const topN = ctx.metaOptions.columnStats.topCategories || 1024;