Fix sql query for cluster info
@@ -20,13 +20,13 @@ class Clusters(Resource):
resources = g.db.execute_many_dict('''
SELECT cluster_name,
SUM(CASE WHEN state = 'running' THEN 1 ELSE 0 END) running,
- SUM(CASE WHEN state = 'running' THEN (definition#>>'{resources,limits,cpu}')::decimal ELSE 0 END) running_cpu,
+ SUM(CASE WHEN state = 'running' THEN (definition#>>'{resources,limits,cpu}')::float ELSE 0 END) running_cpu,
SUM(CASE WHEN state = 'running' THEN (definition#>>'{resources,limits,memory}')::integer ELSE 0 END) running_memory,
SUM(CASE WHEN state = 'scheduled' THEN 1 ELSE 0 END) scheduled,
- SUM(CASE WHEN state = 'scheduled' THEN (definition#>>'{resources,limits,cpu}')::decimal ELSE 0 END) scheduled_cpu,
+ SUM(CASE WHEN state = 'scheduled' THEN (definition#>>'{resources,limits,cpu}')::float ELSE 0 END) scheduled_cpu,
SUM(CASE WHEN state = 'scheduled' THEN (definition#>>'{resources,limits,memory}')::integer ELSE 0 END) scheduled_memory,
SUM(CASE WHEN state = 'queued' THEN 1 ELSE 0 END) queued,
- SUM(CASE WHEN state = 'queued' THEN (definition#>>'{resources,limits,cpu}')::decimal ELSE 0 END) queued_cpu,
+ SUM(CASE WHEN state = 'queued' THEN (definition#>>'{resources,limits,cpu}')::float ELSE 0 END) queued_cpu,
SUM(CASE WHEN state = 'queued' THEN (definition#>>'{resources,limits,memory}')::integer ELSE 0 END) queued_memory
FROM job
GROUP BY cluster_name
