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

Function estimate_bytes_per_row

tests/comparison/data_generator_mapred_common.py:92–103  ·  view source on GitHub ↗
(table_data_generator, row_count)

Source from the content-addressed store, hash-verified

90
91
92def estimate_bytes_per_row(table_data_generator, row_count):
93 original_row_count = table_data_generator.row_count
94 original_output_file = table_data_generator.output_file
95 table_data_generator.row_count = row_count
96 table_data_generator.output_file = BytesIO()
97 table_data_generator.populate_output_file()
98 table_data_generator.output_file.flush()
99 bytes_per_row = len(table_data_generator.output_file.getvalue()) / float(row_count)
100 table_data_generator.output_file.close()
101 table_data_generator.output_file = original_output_file
102 table_data_generator.row_count = original_row_count
103 return max(int(bytes_per_row), 1)
104
105
106def estimate_rows_per_reducer(table_data_generator, mb_per_reducer):

Callers 1

Calls 4

maxFunction · 0.85
populate_output_fileMethod · 0.80
closeMethod · 0.65
flushMethod · 0.45

Tested by

no test coverage detected