lyne7-sc commented on code in PR #19832:
URL: https://github.com/apache/datafusion/pull/19832#discussion_r2699006303
##########
datafusion/sqllogictest/test_files/spark/math/hex.slt:
##########
@@ -63,3 +63,18 @@ query T
SELECT hex(arrow_cast('test', 'LargeBinary')) as lar_b;
----
74657374
+
+statement ok
+CREATE TABLE t_dict_utf8 AS
+SELECT arrow_cast(column1, 'Dictionary(Int32, Utf8)') as dict_col
+FROM VALUES ('foo'), ('bar'), ('foo'), (NULL), ('baz'), ('bar');
+
+query T
+SELECT hex(dict_col) FROM t_dict_utf8;
Review Comment:
After running the SLT tests for `hex`, it seems the planner might unpack
dictionary-encoded inputs like `Dictionary(Int32, Utf8)` or `Dictionary(Int32,
Int64)` into their underlying types (`Utf8View` or `Int64`) before calling the
function. However, `Dictionary(Binary)` appears to stay as a dictionary
```
logical_plan
01)Projection: arrow_typeof(hex(CAST(t_dict_utf8.dict_col AS Utf8View)))
physical_plan
01)ProjectionExec: expr=[arrow_typeof(hex(CAST(dict_col@0 AS Utf8View)))]
logical_plan
01)Projection: arrow_typeof(hex(t_dict_binary.dict_col))
physical_plan
01)ProjectionExec: expr=[arrow_typeof(hex(dict_col@0))]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]