Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/22603 )
Change subject: IMPALA-10349: Support constant folding for non ascii strings ...................................................................... Patch Set 12: (2 comments) http://gerrit.cloudera.org:8080/#/c/22603/10/fe/src/main/java/org/apache/impala/util/StringUtils.java File fe/src/main/java/org/apache/impala/util/StringUtils.java: http://gerrit.cloudera.org:8080/#/c/22603/10/fe/src/main/java/org/apache/impala/util/StringUtils.java@37 PS10, Line 37: Preconditions.checkState(false, "UTF8 encoding failed."); : return null; > Added messages to the preconditions. I see. Can we avoid creating an encoder each time? Using the following code, we don't need to handle exceptions. return StandardCharsets.UTF_8.encode(CharBuffer.wrap(str)); http://gerrit.cloudera.org:8080/#/c/22603/12/fe/src/main/java/org/apache/impala/util/StringUtils.java File fe/src/main/java/org/apache/impala/util/StringUtils.java: http://gerrit.cloudera.org:8080/#/c/22603/12/fe/src/main/java/org/apache/impala/util/StringUtils.java@37 PS12, Line 37: Preconditions.checkState(false, "UTF8 encoding failed."); nit: If we do need this, how about adding the string in the error message? Preconditions.checkState(false, "UTF8 encoding failed for %s", str); -- To view, visit http://gerrit.cloudera.org:8080/22603 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70663457a0b0a3443e586350f0a5996bb75ba64a Gerrit-Change-Number: 22603 Gerrit-PatchSet: 12 Gerrit-Owner: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Comment-Date: Tue, 24 Jun 2025 09:18:01 +0000 Gerrit-HasComments: Yes
