Created 08-14-2017 12:35 PM
I need to create a table with just a field, which is a map of string: string. I have created the table without problems, but when I try to insert the values (they are defined, not in another table) I am not able to achieve it. The code is below.
create table comunidades ( codigo MAP<STRING, STRING> ); INSERT INTO TABLE comunidades SELECT 1, {"AND": '01'};
Created 08-16-2017 09:22 AM
I tried recreating your situation and it worked. see attached.To use the map function the source tables should already exist. I used a text file ruiz.txt with values
$ cat ruiz.txt "AND": '01' "TOO": '02' "MORE": '03'
Hope that helps please accept the reponse if it resolved your problem!
Created 08-16-2017 11:55 AM
The table was filled in the previous actions, but the Ambari platform throws me the specified error above. Now I would need to specify the values into file ruiz.txt as proper key-value pairs, and not inserting null after the file rows. I'll look how to do it. Thank you very much for your patience
Created 08-16-2017 12:05 PM
Nice to know it helped, that's the open source spirit 🙂
Created 08-16-2017 12:12 PM
Yes, it's the better way to solve problems 🙂