You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Rick Hillegas <ri...@gmail.com> on 2020/01/13 13:45:13 UTC

INSERTing rows into a table with a BINARY-typed partition key

Re-posting this message to the user list since I received no reply on 
the dev list.

I would appreciate your advice about how to INSERT data into a table 
with a BINARY-typed partition key.

It seems that hexit strings can be INSERTed into columns which aren't 
partition keys. The hexit strings look fine when you query the table. 
However, hexit strings come back as gibberish after being used as 
partition key values. The following Hive QL script shows this behavior:

USE rick;

DROP TABLE foo;

CREATE TABLE foo (a BINARY) PARTITIONED BY (b BINARY);

INSERT INTO foo PARTITION (b='FEED') VALUES ('FEED');

SELECT * FROM foo;


The result of the terminal SELECT is:

| foo.a | foo.b       |

|-------|-------------|

| FEED  | [B@1b881a6f |


Thanks,
-Rick