- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Inverse of function bin
- Labels:
-
Apache Impala
Created on ā02-21-2017 08:21 AM - edited ā09-16-2022 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a string like "0010011" and I want to convert it to int. It is the inverse of function
bin(a int)
I think
cast("0010011" as binary)
Doesn't exists
How can I do that?
Regards,
JoaquĆn Silva
Created on ā02-22-2017 01:43 PM - edited ā02-22-2017 01:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw this thread after commenting on the Jira. Would "conv()" be a suitable workaround here?
select conv('100010', 2, 10); +-----------------------+ | conv('100010', 2, 10) | +-----------------------+ | 34 | +-----------------------+ Fetched 1 row(s) in 0.24s
Edit: To make things complete, the Jira is IMPALA-4968.
Created ā02-21-2017 09:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Joaqin,
reasonable request. Could you please file a JIRA for this new feature?
It woud be great if someone from the community can pick this up!
Thanks.
Alex
Created on ā02-22-2017 01:43 PM - edited ā02-22-2017 01:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw this thread after commenting on the Jira. Would "conv()" be a suitable workaround here?
select conv('100010', 2, 10); +-----------------------+ | conv('100010', 2, 10) | +-----------------------+ | 34 | +-----------------------+ Fetched 1 row(s) in 0.24s
More information on conv() can be found in the Impala documentation.
Edit: To make things complete, the Jira is IMPALA-4968.

More information on conv() can be found in the Impala documentation.