mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Merge pull request #1359 from laughingman7743/fix_schema_loading_query
Fix: schema loading query for Hive was wrong for non default schema
This commit is contained in:
commit
360028c01f
@ -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