Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

PutDatabaseRecord Error

Highlighted

PutDatabaseRecord Error

New Contributor

I'm trying to put csv to hive using PutDatabaseRecord

but unforunitly I got the below error

110271-untitled.png

1 REPLY 1

Re: PutDatabaseRecord Error

PutDatabaseRecord does not with work Hive (at least with the Apache Hive or HDP Hive JDBC drivers) as it uses methods of the JDBC API that are not supported by the driver. I'm not sure if the Simba driver works or not.

A workaround for managed ACID tables is to use PutHiveStreaming instead, or if you have Hive 3, you can use PutHive3Streaming. The latter is a lot more flexible in terms of input, and relaxes some other requirements for the target table.

For external tables, you could put the files directly into HDFS and create a table atop the target directory. If that "temp table" is to be inserted into a managed Hive table, you can then do that with PutHiveQL (after setting the flowfile content to the appropriate INSERT FROM SELECT HiveQL statement).

Another (less-than-ideal) workaround is to convert individual records to SQL, update it to HiveQL as necessary (not always needed but sometimes), then send individual statements to PutHiveQL. This is very slow and ineffiencent