Skip to content

Commit

Permalink
Merge pull request #1509 from GAwadhwalAtlassian/PublicSchema_Name_Fix
Browse files Browse the repository at this point in the history
[Presto/Athena] Change: remove special rule around public schema
  • Loading branch information
arikfr authored Jan 9, 2017
2 parents 4ccf0de + 869fa26 commit b11685d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions redash/query_runner/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

PROXY_URL = os.environ.get('ATHENA_PROXY_URL')


class Athena(BaseQueryRunner):
noop_query = 'SELECT 1'

Expand Down Expand Up @@ -61,10 +60,7 @@ def get_schema(self, get_stats=False):
results = json.loads(results)

for row in results['rows']:
if row['table_schema'] != 'public':
table_name = '{}.{}'.format(row['table_schema'], row['table_name'])
else:
table_name = row['table_name']
table_name = '{}.{}'.format(row['table_schema'], row['table_name'])

if table_name not in schema:
schema[table_name] = {'name': table_name, 'columns': []}
Expand Down
7 changes: 2 additions & 5 deletions redash/query_runner/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@ def get_schema(self, get_stats=False):
results = json.loads(results)

for row in results['rows']:
if row['table_schema'] != 'public':
table_name = '{}.{}'.format(row['table_schema'], row['table_name'])
else:
table_name = row['table_name']

table_name = '{}.{}'.format(row['table_schema'], row['table_name'])

if table_name not in schema:
schema[table_name] = {'name': table_name, 'columns': []}

Expand Down

0 comments on commit b11685d

Please sign in to comment.