Yida Wu has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24282 )

Change subject: IMPALA-14961: Query Profile Redaction
......................................................................


Patch Set 7:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/24282/6/be/src/service/query-profile-redaction.cc
File be/src/service/query-profile-redaction.cc:

http://gerrit.cloudera.org:8080/#/c/24282/6/be/src/service/query-profile-redaction.cc@405
PS6, Line 405:
             : // Redacts sensitive profile values and optionally records 
alias-to-original mappings.
             : static Status RedactQueryProfileWithAliases(const string_view& 
profile_text,
             :     const Value& source_json,
             :
> We used to iterate over all matches but based on earlier review comments de
Ack.


http://gerrit.cloudera.org:8080/#/c/24282/7/be/src/service/query-profile-redaction.cc
File be/src/service/query-profile-redaction.cc:

http://gerrit.cloudera.org:8080/#/c/24282/7/be/src/service/query-profile-redaction.cc@302
PS7, Line 302:   if (node.HasMember("info_strings") && 
node["info_strings"].IsArray()) {
             :     for (const auto& entry : node["info_strings"].GetArray()) {
             :       const auto [key, value] = ParseInfoStringEntry(entry);
             :       if (key == nullptr || value == nullptr) continue;
             :       if (target_keys.find(key) == target_keys.end()) continue;
             :       if (*value != '\0') values.push_back(value);
             :     }
             :   }
             :
             :   for (auto it = node.MemberBegin(); it != node.MemberEnd(); 
++it) {
             :     auto child_values = CollectInfoStringValuesByKeys(it->value, 
target_keys);
             :     values.insert(
             :         values.end(), make_move_iterator(child_values.begin()),
             :         make_move_iterator(child_values.end()));
             :   }
Here is similar to CollectIdentifierContextsFromJsonProfile().
We could put the info_strings logic into the node for loop to reduce search 
cost and the second prcess on info_strings node.
"
for (auto it = node.MemberBegin(); it != node.MemberEnd(); ++it) {
    if (strcmp(it->name.GetString(), "info_strings") == 0) {
      if (!it->value.IsArray()) continue;
      for (const auto& entry : it->value.GetArray()) {
        ...
      }
      continue;
    }

    auto child_values = CollectInfoStringValuesByKeys(it->value, target_keys);
    values.insert(
        values.end(), make_move_iterator(child_values.begin()),
        make_move_iterator(child_values.end()));
  }
"


http://gerrit.cloudera.org:8080/#/c/24282/7/be/src/service/query-profile-redaction.cc@418
PS7, Line 418: JsonEscapeString(sql_statement)
Trying to understand what the sql_statement input would be like, is it "SELECT 
* FROM users WHERE email = \"[email protected]\"" or "SELECT * FROM users WHERE 
email = "[email protected]""



--
To view, visit http://gerrit.cloudera.org:8080/24282
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If0c5b4911a64888f319f212155df6e08c1800b32
Gerrit-Change-Number: 24282
Gerrit-PatchSet: 7
Gerrit-Owner: Gokul Kolady <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Gokul Kolady <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Fri, 15 May 2026 04:22:00 +0000
Gerrit-HasComments: Yes

Reply via email to