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

Method test_insert_wide_table

tests/query_test/test_insert.py:235–265  ·  view source on GitHub ↗
(self, vector, unique_database)

Source from the content-addressed store, hash-verified

233
234 @SkipIfLocal.parquet_file_size
235 def test_insert_wide_table(self, vector, unique_database):
236 table_format = vector.get_value('table_format')
237
238 # Text can't handle as many columns as Parquet (codegen takes forever)
239 num_cols = 1000 if table_format.file_format == 'text' else 2000
240
241 table_name = unique_database + ".insert_widetable"
242 if vector.get_value('exec_option')['disable_codegen']:
243 table_name += "_codegen_disabled"
244
245 col_descs = widetable.get_columns(num_cols)
246 create_stmt = "CREATE TABLE " + table_name + "(" + ','.join(col_descs) + ")"
247 if vector.get_value('table_format').file_format == 'parquet':
248 create_stmt += " stored as parquet"
249 self.client.execute(create_stmt)
250
251 # Get a single row of data
252 col_vals = widetable.get_data(num_cols, 1, quote_strings=True)[0]
253 insert_stmt = "INSERT INTO " + table_name + " VALUES(" + col_vals + ")"
254 self.client.execute(insert_stmt)
255
256 result = self.client.execute("select count(*) from " + table_name)
257 assert result.data == ["1"]
258
259 result = self.client.execute("select * from " + table_name)
260 types = result.column_types
261 labels = result.column_labels
262 expected = QueryTestResult([col_vals], types, labels, order_matters=False)
263 actual = QueryTestResult(
264 parse_result_rows(result), types, labels, order_matters=False)
265 assert expected == actual
266
267
268class TestInsertPartKey(ImpalaTestSuite):

Callers

nothing calls this directly

Calls 6

QueryTestResultClass · 0.90
parse_result_rowsFunction · 0.90
get_valueMethod · 0.45
joinMethod · 0.45
executeMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected