From 7754407bc86790c2c6375cfa8597bb0ae2a6f31d Mon Sep 17 00:00:00 2001 From: Alison Date: Wed, 30 Aug 2017 21:36:13 -0500 Subject: [PATCH] Autocomplete to 3000; diff fix for map() row() in athena --- client/app/pages/queries/query-editor.js | 2 +- redash/query_runner/athena.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client/app/pages/queries/query-editor.js b/client/app/pages/queries/query-editor.js index 650ea3e1c1..acbbf1664b 100644 --- a/client/app/pages/queries/query-editor.js +++ b/client/app/pages/queries/query-editor.js @@ -76,7 +76,7 @@ function queryEditor(QuerySnippet) { newSchema.reduce((totalLength, table) => totalLength + table.columns.length, 0); // If there are too many tokens we disable live autocomplete, // as it makes typing slower. - if (tokensCount > 5000) { + if (tokensCount > 3000) { editor.setOption('enableLiveAutocompletion', false); } else { editor.setOption('enableLiveAutocompletion', true); diff --git a/redash/query_runner/athena.py b/redash/query_runner/athena.py index 66697a7256..f94cb52106 100644 --- a/redash/query_runner/athena.py +++ b/redash/query_runner/athena.py @@ -139,12 +139,10 @@ def get_schema(self, get_stats=False): if row['extra_info'] == 'partition key': schema[table_name]['columns'].append('[P] ' + row['column_name'] + ' (' + row['column_type'] + ')') - elif row['column_type'][0:3] == 'row(': - schema[table_name]['columns'].append(row['column_name'] + ' (row())') - elif row['column_type'][0:3] == 'map(': - schema[table_name]['columns'].append(row['column_name'] + ' (map())') - else: + elif row['column_type'][0:3] == 'row(' and row['column_type'][0:3] == 'map(': schema[table_name]['columns'].append(row['column_name'] + ' (' + row['column_type'] + ')') + else: + schema[table_name]['columns'].append(row['column_name']) return schema.values()