Hive:Unable to insert values to an array column using "insert".

0 votes

Unable to append data to tables that contain an array column using insert into statements; 

the data type is array < varchar(200) >

With the help of JDBC, I am unable to insert values into an array column by values like :

INSERT INTO example.table (codes) VALUES (['m','n']);

does not recognise the "[" or "{" signs.

Using the array function like ...

INSERT INTO demo.table (codes) VALUES (array('m','n'));

I get the following error using array function:

Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values

Tried the workaround...

INSERT into demo.table (codes) select array('m','n');

unsuccessfully:

Failed to recognize predicate '<EOF>'. Failed rule: 'regularBody' in statement

How can I load array data into columns using jdbc?

Nov 30, 2018 in Big Data Hadoop by slayer
• 29,040 points
455 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

make a dummy table which has at least one row.

INSERT INTO example.table (codes) VALUES (array('m','n')) from dummy limit 1;

hive> select codes example.table;
OK
["m","n"]
Time taken: 0.088 seconds, Fetched: 1 row(s)
answered Nov 30, 2018 by Omkar
• 65,850 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Hive: How to use insert query like SQL

It is now possible to insert like ...READ MORE

answered Nov 5, 2018 in Big Data Hadoop by Omkar
• 65,850 points
27 views
0 votes
1 answer

Hadoop Hive: How to insert data in Hive table?

First, copy data into HDFS. Then create ...READ MORE

answered Nov 12, 2018 in Big Data Hadoop by Omkar
• 65,850 points
101 views
0 votes
1 answer

Hadoop Hive: message:Version information not found in metastore. Unable to instantiate

These are the necessary tables required for metastore that are ...READ MORE

answered Nov 12, 2018 in Big Data Hadoop by Omkar
• 65,850 points
98 views
0 votes
1 answer

Hadoop Hive: How to convert multiple rows into comma separated values?

You can use the aggregator function collect_set to do ...READ MORE

answered Nov 14, 2018 in Big Data Hadoop by Omkar
• 65,850 points
283 views
0 votes
1 answer

Error while connecting to Hive using Java JDBC

Use ​org.apache.hive.jdbc.HiveDriver as your driver. It ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 65,850 points
34 views
0 votes
1 answer

Moving files in Hadoop using the Java API?

I would recommend you to use FileSystem.rename(). ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 12,270 points
537 views
0 votes
1 answer

Hadoop giving java.io.IOException, in mkdir Java code.

I am not sure about the issue. ...READ MORE

answered May 3, 2018 in Big Data Hadoop by Shubham
• 12,270 points
266 views
0 votes
1 answer

How to retrieve column names from java.sql.ResultSet?

You may refer the below code: ResultSet ...READ MORE

answered Jul 4, 2018 in Java by sophia
• 1,400 points
42 views
0 votes
1 answer

Hadoop Hive Hbase: How to insert data into Hbase using Hive (JSON file)?

You can use the get_json_object function to parse the ...READ MORE

answered Nov 15, 2018 in Big Data Hadoop by Omkar
• 65,850 points
243 views
0 votes
1 answer

Hadoop: How to keep duplicates in Hive using collect_set()?

SELECT hash_id, COLLECT_LIST(num_of_cats) AS ...READ MORE

answered Nov 2, 2018 in Big Data Hadoop by Omkar
• 65,850 points
134 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.