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

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


Patch Set 4:

(18 comments)

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

http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.h@30
PS3, Line 30: const std::string_view& profi
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.h@31
PS3, Line 31: const std::string_vie
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.h@36
PS3, Line 36:   std::map<std::string, std::string> alias_to_original_;
> Done
Done


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

http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@49
PS3, Line 49: static constexpr const char* REDACTED_SQL_STATEMENT = 
"[REDACTED_SQL_STATEMENT]";
            :
            : // Escapes a string so it can be safely matched within 
JSON-serialized text.
            : s
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@55
PS3, Line 55: ic_cast<rapidjson
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@71
PS3, Line 71:   return alias_to_original;
            : }
            :
            : sta
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@99
PS3, Line 99: ;
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@100
PS3, Line 100:   vector<string> host_sections =
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@117
PS3, Line 117:   size_t idx = 0;
             :   for (const string& token : sorted_tokens) {
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@136
PS3, Line 136:   }
             :   return text;
             : }
             :
             : // Applies a full alias map to a text blob.
             : static string ApplyAliasMap(const unordered_map<string, string>& 
alias_map, string text) {
             :   return ApplySortedReplacements(
             :       vector<std::pair<string, string>>(alias_map.cbegin(), 
alias_map.cend()),
             :
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@183
PS3, Line 183:   if (node.IsArray()) {
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@335
PS3, Line 335:       CollectInfoStringValuesByKeys(source_json, {"Sql 
Statement"});
             :   for (const string& sql_statement : sql_statements) {
             :     boost::algorithm::replace_all(
             :         redacted, JsonEscapeString(sql_statement), REDAC
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@344
PS3, Line 344: nst std::regex user_kv_re(
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@376
PS3, Line 376: static string UnredactTextWithAliases(
             :     const string_view& text, const map<string, string>& 
alias_to_original) {
             :   if (alias_to_original.empty()) return text;
             :   return ApplySortedReplacements(vector<std::pai
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@441
PS3, Line 441:
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@455
PS3, Line 455:
> Done
Done


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

http://gerrit.cloudera.org:8080/#/c/24282/4/be/src/service/query-profile-redaction.cc@74
PS4, Line 74: static vector<string> CollectInfoStringValuesByKeys(
            :     const Value& node, const unordered_set<string>& target_keys);
No need to have a separate declaration for static functions.


http://gerrit.cloudera.org:8080/#/c/24282/4/be/src/service/query-profile-redaction.cc@96
PS4, Line 96:   static const std::regex HOST_WITH_PORT_RE(
            :       
R"(\b([A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9-]+)*)\:(\d{2,5})\b)");
Declare all regexs after line 49 like this:
static const std::regex 
HOST_WITH_PORT_RE(R"(\b([A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9-]+)*)\:(\d{2,5})\b)",
 regex::optimize);

If capturing groups are not needed, also include the regex::nosubs flag:
static const std::regex 
HOST_WITH_PORT_RE(R"(\b([A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9-]+)*)\:(\d{2,5})\b)",
 regex::optimize | regex::nosubs);



--
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: 4
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: Wed, 13 May 2026 22:51:25 +0000
Gerrit-HasComments: Yes

Reply via email to