Search code examples
sqlhivehiveqlimpala

How to convert binary value to decimal in hive/impala


I want to convert a value - 00000000000100100000000000000111 which is in string to equivalent decimal value - 1179655 in Hive/Impala.Can anyone please help me on this?


Solution

  • Consider below:

    SELECT conv('100100000000000000111', 2, 10)
    

    output:

    enter image description here