Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24817 )
Change subject: IMPALA-15202: Add explicit CAST support between UUID and STRING ...................................................................... IMPALA-15202: Add explicit CAST support between UUID and STRING Add explicit CAST(expr AS UUID) and CAST(expr AS STRING) for Iceberg UUID columns. Implicit casts between UUID and other types remain blocked via UuidCompatibility. Users must write explicit casts to compare UUID columns with string literals or to use string functions. Key changes: - Add CastToUuid to parse canonical 36-char strings into 16-byte UUID values with runtime validation and error reporting - Add CastUuidToString to format UUID bytes as canonical lowercase strings - Register explicit STRING/VARCHAR/CHAR -> UUID and UUID -> STRING cast builtins in CastExpr.initBuiltins() - Support UUID results from constant expression evaluation in LiteralExpr.createBounded() Testing: - Extend iceberg uuid test suite with explicit CAST coverage alongside existing scalar-subquery predicate tests - Add positive tests for UUID <-> STRING casts, UUID -> CHAR(36), CHAR(36)/VARCHAR(36) -> UUID, CAST(NULL AS UUID), and string functions via explicit UUID -> STRING cast - Add negative tests for invalid UUID strings, unsupported cast targets (including UUID -> VARCHAR(36)), and write-path INSERT/CTAS with explicit casts Change-Id: I51af55c6e343f7155cae22bf3714e293f31561d5 Assisted-by: Composer 2.5 (Cursor) Reviewed-on: http://gerrit.cloudera.org:8080/24817 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M be/src/exprs/cast-functions-ir.cc M be/src/exprs/cast-functions.h M be/src/exprs/literal.cc M fe/src/main/java/org/apache/impala/analysis/CastExpr.java M fe/src/main/java/org/apache/impala/analysis/LiteralExpr.java M fe/src/main/java/org/apache/impala/catalog/UuidCompatibility.java M testdata/workloads/functional-query/queries/QueryTest/iceberg-uuid-type.test 7 files changed, 332 insertions(+), 11 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/24817 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I51af55c6e343f7155cae22bf3714e293f31561d5 Gerrit-Change-Number: 24817 Gerrit-PatchSet: 5 Gerrit-Owner: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
