This is an automated email from the ASF dual-hosted git repository.
jasonmfehr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new 99fc96ade IMPALA-13885: (addendum) Add Missing Double Quotes to Log
Messages
99fc96ade is described below
commit 99fc96adea456fe9ad9f9b1cb70699613c88d8f8
Author: jasonmfehr <[email protected]>
AuthorDate: Fri Mar 28 10:46:01 2025 -0700
IMPALA-13885: (addendum) Add Missing Double Quotes to Log Messages
The log messages written when the main workload management processing
loop runs are missing double quotes around field values. These
missing quotes make it difficult to identify the actual field values.
This change adds the missing double quotes around all values in order
to differentiate them from each other.
Sample log message:
I0328 14:21:00.385085 2380412 workload-management-worker.cc:806]
c748e7c938394dc9:f63162aa00000000] wrote completed queries
table="sys.impala_query_log" record_count="3" bytes="6.11 KB"
gather_time="666.758us" exec_time="269.840ms"
query_id="c748e7c938394dc9:f63162aa00000000"
Testing was completed by running the two impacted tests locally.
Change-Id: I70111fb5726fd2623aa76168d44ecfacae90fa83
Reviewed-on: http://gerrit.cloudera.org:8080/22711
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
be/src/service/workload-management-worker.cc | 8 ++++----
tests/custom_cluster/test_query_log.py | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/be/src/service/workload-management-worker.cc
b/be/src/service/workload-management-worker.cc
index 80d161199..37ef244cf 100644
--- a/be/src/service/workload-management-worker.cc
+++ b/be/src/service/workload-management-worker.cc
@@ -796,10 +796,10 @@ void ImpalaServer::WorkloadManagementWorker(const
Version& target_schema_version
stringstream log_msg_props;
log_msg_props
<< " table=\"" << log_table_name << "\""
- << " record_count=" << queries_to_insert.size()
- << " bytes=" << PrettyPrinter::PrintBytes(sql.size())
- << " gather_time=" << PrettyPrinter::Print(gather_time, TUnit::TIME_NS)
- << " exec_time=" << PrettyPrinter::Print(exec_time, TUnit::TIME_NS)
+ << " record_count=\"" << queries_to_insert.size() << "\""
+ << " bytes=\"" << PrettyPrinter::PrintBytes(sql.size()) << "\""
+ << " gather_time=\"" << PrettyPrinter::Print(gather_time,
TUnit::TIME_NS) << "\""
+ << " exec_time=\"" << PrettyPrinter::Print(exec_time, TUnit::TIME_NS)
<< "\""
<< " query_id=\"" << PrintId(tmp_query_id) << "\"";
if (ret_status.ok()) {
diff --git a/tests/custom_cluster/test_query_log.py
b/tests/custom_cluster/test_query_log.py
index 6c8069505..ebea323fe 100644
--- a/tests/custom_cluster/test_query_log.py
+++ b/tests/custom_cluster/test_query_log.py
@@ -585,8 +585,8 @@ class TestQueryLogTableHS2(WorkloadManagementTestSuite):
# logged and important fields are correct.
res = self.assert_impalad_log_contains(
level="WARNING",
- line_regex=r'failed to write completed queries table="{}"
record_count=(\d+) '
- r'bytes=\S+\s\S+ gather_time=\S+ exec_time=\S+
query_id="{}" '
+ line_regex=r'failed to write completed queries table="{}"
record_count="(\d+)" '
+ r'bytes="\S+\s\S+" gather_time="\S+" exec_time="\S+"
query_id="{}" '
r'msg="(.*?)"'.format(QUERY_TBL_LOG, self.insert_query_id),
expected_count=-1)
assert res.group(1) == "1", "Invalid record count in the query failed log
line"
@@ -1120,9 +1120,9 @@ class TestQueryLogTableFlush(CustomClusterTestSuite):
assert \
retry(func=wait_for_insert_query, max_attempts=10, sleep_time_s=1,
backoff=1), \
"did not find completed queries insert dml in the debug web ui"
- self.assert_impalad_log_contains("INFO", r"wrote completed queries "
- r"table=\"{}\" record_count=\d+
bytes=\S+\s\S+ "
- r"gather_time=\S+ exec_time=\S+
query_id=\"{}\""
+ self.assert_impalad_log_contains("INFO", r'wrote completed queries '
+ r'table="{}" record_count="\d+"
bytes="\S+\s?\S*" '
+ r'gather_time="\S+" exec_time="\S+"
query_id="{}"'
.format(QUERY_TBL_LOG,
self.insert_query_id))
@CustomClusterTestSuite.with_args(impalad_args="--query_log_write_interval_s=9999
"