Arnab Karmakar has uploaded this change for review. ( 
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:
- Simplify predicate tests to use CAST('…' AS UUID) instead of scalar
  subqueries
- Add positive tests for CAST(uuid_col AS STRING), CAST('…' AS UUID),
  length(CAST(… AS STRING)), and LIKE with explicit UUID->STRING cast
- Add negative tests for invalid UUID strings and unsupported cast
  targets

Change-Id: I51af55c6e343f7155cae22bf3714e293f31561d5
Assisted-by: Composer 2.5 (Cursor)
---
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, 129 insertions(+), 73 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/17/24817/1
--
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: newchange
Gerrit-Change-Id: I51af55c6e343f7155cae22bf3714e293f31561d5
Gerrit-Change-Number: 24817
Gerrit-PatchSet: 1
Gerrit-Owner: Arnab Karmakar <[email protected]>

Reply via email to