You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Srikrishan Malik <ma...@gmail.com> on 2016/01/19 05:12:25 UTC

Insert map and other complex types in hive using jdbc

Hello devs,

I posted this to the users list but did not get any response, trying the devs:

==
I have a java Map (Map) and a JDBC connection to hive server.
The schema of the table at the server contains a column of type Map.

Is it possible to insert the java Map to the hive table column with similar
datatype using JDBC?
If not, are there any plans to provide this for eg. by setObject in a
prepared statement.
Presently are there any alternatives in addition to loading a file.

I am using jdbc client 0.14.0 can can upgrade if a higher version
provides this facility.


I tried:

"create table test(key string, value Map<String, String>)"
"insert into table test values ('keywer', map('subkey', 'subvalue'))
from dummy limit 1;"

ref: Hive inserting values to an array complex type column

Error: Error while compiling statement: FAILED: ParseException line
1:69 missing EOF at 'from' near ')' (state=42000,code=40000)"


Thanks
Sri