Support Questions

Find answers, ask questions, and share your expertise

Exercise 2 : Long time running + error from intermediate_access_logs table creation query

avatar
Contributor

There are a few other post on the same topic however none of the suggested fixes have worked. This query (which I am using HUE Hive) just hangs. I also started the Zookeeper as suggested in another post, but it did not help. I did let it run over night and it produced the following error:

 

Error while processing statement: FAILED: Error in acquiring locks: Locks on the underlying objects cannot be acquired. retry after some time

 

Anyone know a solution?

 

CREATE EXTERNAL TABLE intermediate_access_logs (
ip STRING,
date STRING,
method STRING,
url STRING,
http_version STRING,
code1 STRING,
code2 STRING,
dash STRING,
user_agent STRING)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'input.regex' = '([^ ]*) - - \\[([^\\]]*)\\] "([^\ ]*) ([^\ ]*) ([^\ ]*)" (\\d*) (\\d*) "([^"]*)" "([^"]*)"',
'output.format.string' = "%1$$s %2$$s %3$$s %4$$s %5$$s %6$$s %7$$s %8$$s %9$$s")
LOCATION '/user/hive/warehouse/original_access_logs';

1 ACCEPTED SOLUTION

avatar
Rising Star

I don't have time at the moment to check the QuickStart VM but let's check the /usr/lib/ hive/lib location (rather than ~/parcels or ~/lib). Also, the ADD JAR command has to be run from within Beeline.

View solution in original post

12 REPLIES 12

avatar
Rising Star

Hi jbatspv,

 

 

Have all instances of HiveServer2 been restarted already?

avatar
Contributor

In the Cloudera Management Service Actions under the CDH 5 Packages dashboard I restarted the service. This fixed the issue and I was able to complete this step successfully as well, but get another error described below.

 

CREATE EXTERNAL TABLE tokenized_access_logs (
ip STRING,
date STRING,
method STRING,
url STRING,
http_version STRING,
code1 STRING,
code2 STRING,
dash STRING,
user_agent STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
LOCATION '/user/hive/warehouse/tokenized_access_logs';

 

I did however get the following error when I hit this line of code. Any ideas?

ADD JAR {{lib_dir}}/hive/lib/hive-contrib.jar;

 

Error while processing statement: java.net.URISyntaxException: Illegal character in path at index 0: {{lib_dir}}/hive/lib/hive-contrib.jar

 

avatar
Contributor

Based on another article I have tried the following combinations but all issue and error that the hive-contrib.jar does not exist.

 

ADD JAR /hive/lib/hive-contrib.jar;

ADD JAR /home/cloudera/lib/hive-contrib.jar;

ADD JAR /opt/cloudera/parcels/CDH/lib/hive/hive-contrib.jar;

avatar
Rising Star

Hi jbatspv,

 

Which code/script is running?

Does hive-contrib.jar exist under /lib/hive/lib?

avatar
Contributor

Which code/script is running? How can I tell?

 

I ran this but got similar error.

ADD JAR /lib/hive/lib/hive-contrib.jar;

Error while processing statement: /lib/hive/lib/hive-contrib.jar does not exist

 

Really appreciate you work with me on this!!

avatar
Rising Star

Sure, glad to help.

 

 

Does hive-contrib.jar exist at /opt/cloudera/parcels/CDH/lib/hive/lib/hive-contrib.jar? You can navigate to this directory to verify.

 

Was the ADD JAR command run with Beeline?

 

What's the full error output?

 

 

avatar
Contributor
I am running this in HUE Hive ADD JAR /opt/cloudera/parcels/CDH/lib/hive/lib/hive-contrib.jar     Error while processing statement: /opt/cloudera/parcels/CDH/lib/hive/lib/hive-contrib.jar does not exist Hopefully the screen shot will come though, but when I do ls from terminal window I see the folder "parcels" but it is highlighted green. If I try ls /parcels its says No Such File or Directory
Terminal.png

avatar
Rising Star

I don't have time at the moment to check the QuickStart VM but let's check the /usr/lib/ hive/lib location (rather than ~/parcels or ~/lib). Also, the ADD JAR command has to be run from within Beeline.

avatar
Contributor

I found the file hive-contrib.jar the command ls /usr/lib/have/lib via the terminal window. I ran ADD JAR /usr/lib/hive/lib/hive-contrib.jar; from the HUE Hive and it worked! I also was able to run the last statement successfully INSERT OVERWRITE TABLE tokenized_access_logs SELECT * FROM intermediate_access_logs;

 

I have now been able to complete exercise 2!! 

 

Big thanks for the help!