decode the binary string to actual String which includes the character €,´,ü and so on

Hello Dremio,

We have Hbase table in Datasets which contains encoded binary string in one column, which includes the character €,´,ü and so on.( but it is encoded as binary string and stored in that column) Characters list are here(https://www.i18nqa.com/debug/utf8-debug.html)

I wants to decode the binary string to actual String (to those characters which I mentioned above)

I tried with CAST function

SELECT CAST(test_value AS VARCHAR)
FROM table_name
It is working well for the normal string. But throwing exception for the row contains the special string(Binary string format)

Error : Unexpected byte 0xb4 at position 39076 encountered while decoding UTF8 string.

Is there any functions to convert the special character strings which is in the form of encoded binary string?

Please see this tutorial for examples with HBase: https://www.dremio.com/tutorials/hbase-sql-dremio/

STRING_BINARY() is probably what you’re looking for.

Hi Kelly,

STRING_BINARY is not working for Special characters

Can you provide an example binary value and the error you are getting?

Hi Kelly,

my base binary

REFUQUZPUk1BVFZFUlNJT047NQ0KRk9STUFUO21tZGQNClNUQVJUO0xQIDYxMDU1O002MTA1NV8xNjsyMDAwO002MTA1NV8xNjtDMzQ7MDYvMTQvMjAxODsxNTo1MzozMQ0KVA==

My UTF8 (ASCII)

DATAFORMATVERSION;5
FORMAT;mmdd
START;LP 61055;M61055_16;2000;M61055_16;C34;06/14/2018;15:53:31

my Special character is ‘ü’ is not converting, that is my problem :slight_smile: