presto: use the disambiguated column name

This commit is contained in:
Colin Dellow 2016-02-24 15:40:22 -05:00
parent 177b62ea40
commit 0ebb53994b

View File

@ -83,7 +83,7 @@ class Presto(BaseQueryRunner):
cursor.execute(query)
column_tuples = [(i[0], PRESTO_TYPES_MAPPING.get(i[1], None)) for i in cursor.description]
columns = self.fetch_columns(column_tuples)
rows = [dict(zip(([c[0] for c in column_tuples]), r)) for i, r in enumerate(cursor.fetchall())]
rows = [dict(zip(([c['name'] for c in columns]), r)) for i, r in enumerate(cursor.fetchall())]
data = {'columns': columns, 'rows': rows}
json_data = json.dumps(data, cls=JSONEncoder)
error = None