java - How to handle newline character in HIVE on HBase? -


i inserting data hbase java program. need convert byte arrays insert hbase doing so. when there newline character in input string, storing hexadecimal values in hbase (eg: tried insert string "prasad\r\nchowdary" in hbase prasad\x0d\x0achowdary).

my problem when data in hbase, when try query table hive, jdbc resultset been repeating 2 time single row.

so how avoid converting \r\n hexadecimal when inserting hbase.

if want put new line or other set of characters in string modify them such java treats them string.

convert "prasad\r\nchowdary" "prasad\r\nchowdary"

that use escape character "\" before new line convert bytes. should like.

string name = "prasad\\r\\nchowdary"; put.add(bytes.tobytes("family"),bytes.tobytes("qualifier"),bytes.tobytes("name")); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -