mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Use a paginator when iterating over glue tables
Without this you only get the first 100 tables in the glue database
This commit is contained in:
parent
570187fc1f
commit
dceb58cd79
@ -125,9 +125,11 @@ class Athena(BaseQueryRunner):
|
||||
region_name=self.configuration['region']
|
||||
)
|
||||
schema = {}
|
||||
paginator = client.get_paginator('get_tables')
|
||||
|
||||
for database in client.get_databases()['DatabaseList']:
|
||||
for table in client.get_tables(DatabaseName=database['Name'])['TableList']:
|
||||
iterator = paginator.paginate(DatabaseName=database['Name'])
|
||||
for table in iterator.search('TableList[]'):
|
||||
table_name = '%s.%s' % (database['Name'], table['Name'])
|
||||
if table_name not in schema:
|
||||
column = [columns['Name'] for columns in table['StorageDescriptor']['Columns']]
|
||||
|
Loading…
Reference in New Issue
Block a user