Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/11425 )
Change subject: IMPALA-2063 Remove newline characters in query status. ...................................................................... Patch Set 5: (4 comments) http://gerrit.cloudera.org:8080/#/c/11425/5//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/11425/5//COMMIT_MSG@10 PS5, Line 10: Remove any duplicated newline characters within strings as well. (The latter Please wrap the lines at 72 characters. http://gerrit.cloudera.org:8080/#/c/11425/5/be/src/util/runtime-profile.cc File be/src/util/runtime-profile.cc: http://gerrit.cloudera.org:8080/#/c/11425/5/be/src/util/runtime-profile.cc@545 PS5, Line 545: // Strip out any whitespace trailing the string. : size_t end = value.find_last_not_of("\f\r\n\v \t"); : if (end > 0 && end < value.size()) { : value.resize(end + 1); : } There is comfortable StripTrailingWhitespace function in https://github.com/apache/impala/blob/master/be/src/gutil/strings/strip.h that could do this for you. I am not sure if would consider exactly the same charset as whitespace though. http://gerrit.cloudera.org:8080/#/c/11425/5/be/src/util/runtime-profile.cc@551 PS5, Line 551: // If there is a newline-like character, remove duplicates : static std::regex multiple_newline("\n\n+"); : if (std::regex_search(value, multiple_newline)) { : value = std::regex_replace(value, multiple_newline, "\n"); : } strip.h also contains a function for this, see StripDupCharacters. http://gerrit.cloudera.org:8080/#/c/11425/5/tests/query_test/test_cancellation.py File tests/query_test/test_cancellation.py: http://gerrit.cloudera.org:8080/#/c/11425/5/tests/query_test/test_cancellation.py@175 PS5, Line 175: nit: unnecessary new line -- To view, visit http://gerrit.cloudera.org:8080/11425 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2bbd7d7fe2c6d0f3799d0e6b336710bccfef0ab1 Gerrit-Change-Number: 11425 Gerrit-PatchSet: 5 Gerrit-Owner: Michal Ostrowski <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-Comment-Date: Thu, 20 Sep 2018 16:22:47 +0000 Gerrit-HasComments: Yes
