From b5a6d6974c500be9d244d84d88cf0fd1c372db77 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 18 Jul 2016 11:58:19 +0200 Subject: [PATCH] Do not cast type in category ramp --- lib/cartodb/backends/turbo-carto-postgres-datasource.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/backends/turbo-carto-postgres-datasource.js b/lib/cartodb/backends/turbo-carto-postgres-datasource.js index 848e5902..fa033a42 100644 --- a/lib/cartodb/backends/turbo-carto-postgres-datasource.js +++ b/lib/cartodb/backends/turbo-carto-postgres-datasource.js @@ -32,14 +32,9 @@ methodTemplates.category = dot.template([ ' ORDER BY 2 DESC', '),', 'agg_categories AS (', - ' SELECT \'__other\' category', + ' SELECT category', ' FROM categories', - ' WHERE rank >= {{=it._buckets}}', - ' GROUP BY 1', - ' UNION ALL', - ' SELECT CAST(category AS text)', - ' FROM categories', - ' WHERE rank < {{=it._buckets}}', + ' WHERE rank <= {{=it._buckets}}', ')', 'SELECT array_agg(category) AS category FROM agg_categories' ].join('\n'));