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

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


Patch Set 3:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/24282/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/24282/2//COMMIT_MSG@12
PS2, Line 12: targeted
> Nit: targeted
Done


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

http://gerrit.cloudera.org:8080/#/c/24282/2/be/src/service/query-profile-redaction-test.cc@34
PS2, Line 34: static constexpr const char* PROFILE_FILE = 
"tpcds_72_local_run_profile.json";
> Instead of using an anonymous namespace, add the "static" keyword to the in
Done


http://gerrit.cloudera.org:8080/#/c/24282/2/be/src/service/query-profile-redaction-test.cc@140
PS2, Line 140:
             :
             :
             :
             :
> Can the unredacted output be compared to the tpcds_72_local_run_profile.jso
Done


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@36
PS3, Line 36:   std::unordered_map<std::string, std::string> alias_to_original_;
This map is sorted in a couple different places.  Declare it as a std::map 
instead so the sorting happens automatically.


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@55
PS3, Line 55: string_view token
Use const string_view&.  Also on lines 66, 116, 130, 165, 175, 343, 433, 441, 
454.


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@136
PS3, Line 136: // Sorts replacement entries by descending token length to avoid 
partial overlap issues.
             : static vector<std::pair<string, string>> SortByTokenLengthDesc(
             :     vector<std::pair<string, string>> entries) {
             :   std::sort(entries.begin(), entries.end(),
             :       [](const std::pair<string, string>& a, const 
std::pair<string, string>& b) {
             :         return a.first.size() > b.first.size();
             :       });
             :   return entries;
             : }
This function is only called from one place, move the code to 
ApplySortedReplacements and delete this function.  Another option is to use a 
std::set with a custom comparison function which would be much cleaner overall.


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@344
PS3, Line 344: shared_ptr<unordered_map<string, string>>
A shared_ptr doesn't provide value here.  Pass in an unordered_map<string, 
string>&.


http://gerrit.cloudera.org:8080/#/c/24282/3/be/src/service/query-profile-redaction.cc@376
PS3, Line 376:   } else {
             :     unordered_map<string, string> aliases = BuildAliasMap(
             :         vector<string>(username_tokens.cbegin(), 
username_tokens.cend()), "user");
             :     redacted = ApplyAliasMap(aliases, redacted);
It does not seem possible for this else case to happen.  Same on lines 388, 
400, and 422.



--
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: 3
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 19:35:36 +0000
Gerrit-HasComments: Yes

Reply via email to