Do not cast type in category ramp

This commit is contained in:
Raul Ochoa 2016-07-18 11:58:19 +02:00
parent 26bab029f4
commit b5a6d6974c

View File

@ -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'));