Work around Hive/Spark SHOW SCHEMAS incompatibility

Spark returns a different column name (databaseName instead of database_name), but for both spark and hive the first column contains the database name (#109)
This commit is contained in:
Andreas Lang 2017-05-01 20:55:26 +01:00 коммит произвёл Jing Wang
Родитель 34f3c3db92
Коммит cd144b198d
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -201,7 +201,7 @@ class HiveDialect(default.DefaultDialect):
def get_schema_names(self, connection, **kw):
# Equivalent to SHOW DATABASES
return [row.database_name for row in connection.execute('SHOW SCHEMAS')]
return [row[0] for row in connection.execute('SHOW SCHEMAS')]
def get_view_names(self, connection, schema=None, **kw):
# Hive does not provide functionality to query tableType