Support Questions
Find answers, ask questions, and share your expertise

Cannot insert to phoenix table through hive

New Contributor

I was able to create phoenix table by hive cli, but insert fails. Any pointers on why its failing?

In hive client :
ADD JARS /usr/hdp/2.3.2.0-2950/apache-phoenix-4.8.2-HBase-1.0-bin/phoenix-hive-4.8.2-HBase-1.0.jar;
insert into table sud_test values ("xx",1, 2.0, 3.0);


Error: java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
...
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
....
Caused by: java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
Caused by: java.lang.RuntimeException: Map operator initialization failed
at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:140)
... 22 more
Caused by: java.lang.NoSuchMethodError: org.apache.phoenix.util.QueryUtil.getUrl(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;)Ljava/lang/String;
at org.apache.phoenix.hive.util.PhoenixConnectionUtil.getConnection(PhoenixConnectionUtil.java:93)

2 REPLIES 2

Re: Cannot insert to phoenix table through hive

@sudhir p

Looks like jars issue, You might want to check if you updated correct phoenix jars. Any reason you are using apache phoenix instead of HDP shipped one?

Re: Cannot insert to phoenix table through hive

New Contributor

Thanks Sandeep. Issue was we are using older version of phoenix 4.4 , some one copied 4.8 phoenix jars to server that lead me believe we are using 4.8 but actually servers are of version 4.4.