Csaba Ringhofer 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/11/fe/src/main/java/org/apache/impala/analysis/StringLiteral.java
File fe/src/main/java/org/apache/impala/analysis/StringLiteral.java:

http://gerrit.cloudera.org:8080/#/c/22603/11/fe/src/main/java/org/apache/impala/analysis/StringLiteral.java@71
PS11, Line 71: I
> nit: "It" ?
Done


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;
> Can we throw the exception explicitly with the string in the message? Using
Added messages to the preconditions.
I think that using preconditions is better here than throwing another 
exception, as I consider these program errors. Java String->UTF8 should always 
succeed AFAIK, fromUtf8Buffer() with canFail==true is only called where we 
shouldn't see bad strings (Kudu default values/range partitions come from 
string literals that are checked for validity). One thing that could introduce 
invalid strings is an existing Kudu table with range partitions on a binary 
column that is not valid utf8. Currently you can't create such tables in 
Impala, so I couldn't check how we handle these:

create table tkudubinpart (b binary primary key, i int) partition by range(b) 
(partition values < cast("a" as binary)) stored as kudu;
result:
ImpalaRuntimeException: Error creating Kudu table 'impala::default.tkudubinpart'
CAUSED BY: ImpalaRuntimeException: Key columns not supported for type: Type: 
binary

I can create a ticket for adding support for range partitions on binary 
columns, but I am not sure if this is really an important use case.



--
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 08:30:26 +0000
Gerrit-HasComments: Yes

Reply via email to