martin-g commented on code in PR #19235:
URL: https://github.com/apache/datafusion/pull/19235#discussion_r2609789430
##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -52,8 +54,33 @@ impl Default for SparkHex {
impl SparkHex {
pub fn new() -> Self {
+ let int64 = Coercion::new_implicit(
+ TypeSignatureClass::Native(logical_int64()),
+ vec![TypeSignatureClass::Integer, TypeSignatureClass::Numeric],
+ NativeType::Int64,
+ );
+ let string = Coercion::new_implicit(
+ TypeSignatureClass::Native(logical_string()),
+ vec![TypeSignatureClass::Native(logical_string())],
+ NativeType::String,
+ );
+ let binary = Coercion::new_implicit(
+ TypeSignatureClass::Native(logical_binary()),
+ vec![TypeSignatureClass::Binary],
Review Comment:
```
> CREATE TABLE binary_data (id INTEGER, data BYTEA);
0 row(s) fetched.
Elapsed 0.002 seconds.
> INSERT INTO binary_data (id, data) VALUES (1, X'48656C6C6F');
+-------+
| count |
+-------+
| 1 |
+-------+
1 row(s) fetched.
Elapsed 0.017 seconds.
> select * from binary_data;
+----+------------+
| id | data |
+----+------------+
| 1 | 48656c6c6f |
+----+------------+
1 row(s) fetched.
Elapsed 0.003 seconds.
> select arrow_cast(data, 'LargeBinary') from binary_data;
+--------------------------------------------------+
| arrow_cast(binary_data.data,Utf8("LargeBinary")) |
+--------------------------------------------------+
| 48656c6c6f |
+--------------------------------------------------+
1 row(s) fetched.
Elapsed 0.001 seconds.
```
--
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]