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

Method write_query_profile

tests/stress/query_runner.py:437–461  ·  view source on GitHub ↗

Write out the query profile bound to this object to a given directory. The file name is generated and will contain the query ID. Use the optional prefix parameter to set a prefix on the filename. Example return: tpcds_300_decimal_parquet_q21_00000001_a38c8331_profile.txt

(self, directory, prefix=None)

Source from the content-addressed store, hash-verified

435 or self.other_error)
436
437 def write_query_profile(self, directory, prefix=None):
438 """
439 Write out the query profile bound to this object to a given directory.
440
441 The file name is generated and will contain the query ID. Use the optional prefix
442 parameter to set a prefix on the filename.
443
444 Example return:
445 tpcds_300_decimal_parquet_q21_00000001_a38c8331_profile.txt
446
447 Parameters:
448 directory (str): Directory to write profile.
449 prefix (str): Prefix for filename.
450 """
451 if not (self.profile and self.query_id):
452 return
453 if prefix is not None:
454 file_name = prefix + '_'
455 else:
456 file_name = ''
457 file_name += self.query.logical_query_id + '_'
458 file_name += self.query_id.replace(":", "_") + "_profile.txt"
459 profile_log_path = os.path.join(directory, file_name)
460 with open(profile_log_path, "w") as profile_log:
461 profile_log.write(self.profile)
462
463
464def _add_row_to_hash(row, curr_hash):

Callers 2

_write_query_profileMethod · 0.80
get_reportFunction · 0.80

Calls 2

joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected