07-06-2014 09:07 AM
While working with CDH5, hive and RegexSerDe there are some issues in hive-editor in hue environment. Initially a table is created:
CREATE TABLE access_log ( `ip` STRING, `time_local` STRING, `method` STRING, `uri` STRING, `protocol` STRING, `status` STRING, `bytes_sent` STRING, `referer` STRING, `useragent` STRING ) ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' WITH SERDEPROPERTIES ( 'input.regex'='^(\\S+) \\S+ \\S+ \\[([^\\+)\\] "(\\w+) (\\S+) (\\S+)" (\\d+) (\\d+) "([^"]+)" "([^"]+)".*' ) STORED AS TEXTFILE LOCATION '/user/test/apachelogs/access_log-20140622';
Then data is moved into the table.
LOAD DATA INPATH /user/test/apachelogs/access_log-20140622' into table access_log;
Up to here all is fine. But when executing the follwoing statement, a mapreduce job is started and freezes at 5%:
select count(*) from access_log ;
The problem is caused by a classpath issue, so the RegexSerDe is not found within the hive editor. I started the hive shell on commandline and added a jar:
add jar /path/to/hive-contrib.jar; select count(*) from access_log;
Here the query runs and returns the correct results.
Question: how to run the query in hue/hive-editor? I tried settings and add jar resource, but the query does not run ...
07-16-2014 06:29 AM
Now it is working!
Main problems seems to be the web frontend, which does not give feedback. There was an error in the jar path and it could not be found. The shell on command line is more intuitive :-)
07-16-2014 12:43 PM
05-17-2016 10:14 AM - edited 05-17-2016 10:16 AM
What if I am not able to add the jar via setting tab [error - Insufficient privileges to execute ADD] ?
Also if I want this jar to be available to all the users, how can i do that ?