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.

APACHE kudu java API

APACHE kudu java API

Explorer

I am trying to update the kudu table using java api.

i ahve table named users and it has two columns username and age,primary key is set when creating the table 

when i try to update the age from 26 whicc is already been inserted to 29.

 i get the following exception

org.apache.kudu.client.NonRecoverableException: Primary key column usernameis not set
at org.apache.kudu.client.KuduException.transformException(KuduException.java:107)
at org.apache.kudu.client.KuduSession.apply(KuduSession.java:94)
at java_app.Update_kudu.main(Update_kudu.java:91)
Caused by: java.lang.IllegalStateException: Primary key column username is not set

 

code goes like this 

Update update = table.newUpdate();
PartialRow row = update.getRow();
row.addInt("age", Integer.parseInt("27"));
session.apply(update);

please help me with this .ASAP

Don't have an account?
Coming from Hortonworks? Activate your account here