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;