MCPcopy Create free account
hub / github.com/apache/impala / create_table_from_describe

Method create_table_from_describe

tests/comparison/db_connection.py:408–417  ·  view source on GitHub ↗
(self, table_name, describe_rows)

Source from the content-addressed store, hash-verified

406 raise Exception('unable to parse: {0}, type: {1}'.format(col_name, col_type))
407
408 def create_table_from_describe(self, table_name, describe_rows):
409 primary_key_names = self._fetch_primary_key_names(table_name)
410 table = Table(table_name.lower())
411 for row in describe_rows:
412 col_name, data_type = row[:2]
413 col_type = self.parse_col_desc(data_type)
414 col = self.create_column(col_name, col_type)
415 col.is_primary_key = col_name in primary_key_names
416 table.add_col(col)
417 return table
418
419 def describe_table(self, table_name):
420 '''Return a Table with table and col names always in lowercase.'''

Callers 1

describe_tableMethod · 0.95

Calls 5

parse_col_descMethod · 0.95
create_columnMethod · 0.95
TableClass · 0.90
add_colMethod · 0.45

Tested by

no test coverage detected