Created 02-21-2017 04:41 AM
I am using HDP 2.3
JDBC CODE:
// 1. check the connection
Connection con = DriverManager.getConnection("jdbc:hive2://ppp.qqq.net:10000/default", "hive",
"hive");
Statement stmt = con.createStatement();
// 2.Find Time Stamp
ResultSet res_max = stmt.executeQuery(history_max_time_stamp_query);
if (res_max.next()) {
// System.out.println(res.getString(1) + "\t" + res.getString(2));
time_stamp = res_max.getString(1);
System.out.println(res_max.getString(1));
}
//3 while (history_delete_res1.next()) {
String delete = "delete from "+orc_table_name +" where "+primary_key +"=" +value;
System.out.println("delete: " + delete);
System.out.println("=====================");
//System.out.println(kamrepcd +" "+ kamrepnm );
stmt.executeQuery(delete);
JARS used :
javac -cp /usr/hdp/2.3.4.7-4/hadoop/hadoop-common-2.7.1.2.3.4.7-4.jar:/usr/hdp/2.3.4.7-4/hive/lib/hive-common-1.2.1.2.3.4.7-4.jar:/usr/hdp/2.3.4.7-4/hive/lib/hive-jdbc-1.2.1.2.3.4.7-4-standalone.jar:. hive_connection.java
java -cp /usr/hdp/2.3.4.7-4/hadoop/hadoop-common-2.7.1.2.3.4.7-4.jar:/usr/hdp/2.3.4.7-4/hive/lib/hive-common-1.2.1.2.3.4.7-4.jar:/usr/hdp/2.3.4.7-4/hive/lib/hive-jdbc-1.2.1.2.3.4.7-4-standalone.jar:. hive_connection
Table description :ORC with transaction true (I am able to delete record through hive shell)
ERROR:
Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.
I am able to delete data through hive shell but not through jdbc connection
Created 02-21-2017 04:47 AM
The issue might be due to incorrect parameters for ACID, try below set:
hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
hive.compactor.initiator.on=true.
Created 02-21-2017 04:47 AM
The issue might be due to incorrect parameters for ACID, try below set:
hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
hive.compactor.initiator.on=true.