here is my table
hive> desc test_tab;
OK
test_map map<string,string>
test_date string
# Partition Information
# col_name data_type comment
test_date string
Time taken: 0.087 seconds, Fetched: 7 row(s)
and here is my insert statement
hive> insert into table test_tab
> values ('2018-02-28', map("key","val"));
but i get
FAILED: ParseException line 2:0 cannot recognize input near 'values' '(' ''2018-02-28'' in select clause
I also tried
hive> insert into table test_tab partition (test_date = '2018-02-28')
> select map("key","val");
FAILED: NullPointerException null
what am i doing wrong?
Here is hive version info
Hive 0.13.1-SNAPSHOT
You can load the data into the hive table in two ways
* Using HDFS command:
Your table structure should by MAP KEYS TERMINATED BY '=' (Any delimiter)
sample input.txt
Feb=28
Once you uplload the file into the Hadoop fs, then load data into the table:
If similar data already present in the file system you can insert that into your table via hive Query.
NOTE: MAP KEYS TERMINATED BY '=' constraint not necessarily required for test_tab table.