You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Cheappie (via GitHub)" <gi...@apache.org> on 2023/06/01 18:40:29 UTC
[GitHub] [arrow-datafusion] Cheappie opened a new issue, #6521: Support cast from HEX to FixedSizeBinary
Cheappie opened a new issue, #6521:
URL: https://github.com/apache/arrow-datafusion/issues/6521
### Is your feature request related to a problem or challenge?
I would like to be able to cast HEX value to a FixedSizeBinary. For example PostgreSQL interprets value as hex using such syntax `E'\\xDEADBEEF'::bytea` and converts it to binary type.
I have seen that there is some support for interpreting text as bytes but afaik there is no way to hint it that the payload is a hex value.
```
❯ select arrow_cast('002920a3044b3c9f56e797b8'::bytea, 'FixedSizeBinary(12)');
Error during planning: byte slice doesn't match fixed size binary value length ( err looks something like that )
```
### Describe the solution you'd like
Any kind of variation that would allow me to specify hex value then parse it as fixed size binary.
For example
```
❯ select arrow_cast(E'\\xDEADBEEF'::bytea, 'FixedSizeBinary(4)');
```
Then I would like to be able to query over fixed size binary type.
```
select *
from table
where
header = arrow_cast(E'\\xDEADBEEF'::bytea, 'FixedSizeBinary(4)');
```
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Support cast from HEX to FixedSizeBinary [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on issue #6521:
URL: https://github.com/apache/datafusion/issues/6521#issuecomment-3706963990
Works on main like so:
```sql
> select arrow_typeof(X'FF01');
+-------------------------------+
| arrow_typeof(Binary("255,1")) |
+-------------------------------+
| Binary |
+-------------------------------+
1 row(s) fetched.
Elapsed 0.004 seconds.
> select arrow_cast(X'DEADBEEF', 'FixedSizeBinary(4)');
+------------------------------------------------------------------+
| arrow_cast(Binary("222,173,190,239"),Utf8("FixedSizeBinary(4)")) |
+------------------------------------------------------------------+
| deadbeef |
+------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.003 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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Support cast from HEX to FixedSizeBinary [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #6521: Support cast from HEX to FixedSizeBinary
URL: https://github.com/apache/datafusion/issues/6521
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
[GitHub] [arrow-datafusion] alamb commented on issue #6521: Support cast from HEX to FixedSizeBinary
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #6521:
URL: https://github.com/apache/arrow-datafusion/issues/6521#issuecomment-1608189819
I believe this may be resolved in https://github.com/apache/arrow-datafusion/pull/6767
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] comphead commented on issue #6521: Support cast from HEX to FixedSizeBinary
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on issue #6521:
URL: https://github.com/apache/arrow-datafusion/issues/6521#issuecomment-1577875225
Hi @Cheappie would you mind attach postgres query doing the same?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org