mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Fix schema loading query for Hive query runner
This commit is contained in:
parent
7ee41d41b5
commit
6a42daffe2
@ -78,11 +78,11 @@ class Hive(BaseSQLQueryRunner):
|
||||
|
||||
tables_query = "show tables in %s"
|
||||
|
||||
columns_query = "show columns in %s"
|
||||
columns_query = "show columns in %s.%s"
|
||||
|
||||
for schema_name in filter(lambda a: len(a) > 0, map(lambda a: str(a['database_name']), self._run_query_internal(schemas_query))):
|
||||
for table_name in filter(lambda a: len(a) > 0, map(lambda a: str(a['tab_name']), self._run_query_internal(tables_query % schema_name))):
|
||||
columns = filter(lambda a: len(a) > 0, map(lambda a: str(a['field']), self._run_query_internal(columns_query % table_name)))
|
||||
columns = filter(lambda a: len(a) > 0, map(lambda a: str(a['field']), self._run_query_internal(columns_query % (schema_name, table_name))))
|
||||
|
||||
if schema_name != 'default':
|
||||
table_name = '{}.{}'.format(schema_name, table_name)
|
||||
|
Loading…
Reference in New Issue
Block a user