|
@@ -90,7 +90,7 @@ class HiveServerTable(Table):
|
|
|
@property
|
|
@property
|
|
|
def partition_keys(self):
|
|
def partition_keys(self):
|
|
|
try:
|
|
try:
|
|
|
- return [PartitionKeyCompatible(row['col_name'], row['data_type'], row['comment']) for row in self._get_partition_column()]
|
|
|
|
|
|
|
+ return [PartitionKeyCompatible(row['col_name'], row['data_type'], row['comment']) for row in self._get_partition_columns()]
|
|
|
except:
|
|
except:
|
|
|
LOG.exception('failed to get partition keys')
|
|
LOG.exception('failed to get partition keys')
|
|
|
return []
|
|
return []
|
|
@@ -119,14 +119,14 @@ class HiveServerTable(Table):
|
|
|
col_row_index = col_row_index + 1
|
|
col_row_index = col_row_index + 1
|
|
|
cols.pop(0)
|
|
cols.pop(0)
|
|
|
end_cols_index = cols.index('')
|
|
end_cols_index = cols.index('')
|
|
|
- return rows[col_row_index:][:end_cols_index] + self._get_partition_column()
|
|
|
|
|
|
|
+ return rows[col_row_index:][:end_cols_index] + self._get_partition_columns()
|
|
|
except ValueError: # DESCRIBE on columns and nested columns does not always contain additional rows beyond cols
|
|
except ValueError: # DESCRIBE on columns and nested columns does not always contain additional rows beyond cols
|
|
|
return rows[col_row_index:]
|
|
return rows[col_row_index:]
|
|
|
except:
|
|
except:
|
|
|
# Impala does not have it
|
|
# Impala does not have it
|
|
|
return rows
|
|
return rows
|
|
|
|
|
|
|
|
- def _get_partition_column(self):
|
|
|
|
|
|
|
+ def _get_partition_columns(self):
|
|
|
rows = self.describe
|
|
rows = self.describe
|
|
|
try:
|
|
try:
|
|
|
col_row_index = list(map(itemgetter('col_name'), rows)).index('# Partition Information') + 3
|
|
col_row_index = list(map(itemgetter('col_name'), rows)).index('# Partition Information') + 3
|