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

How to define Serde in HIVE Ambari 2.1

I have this weblog data

79.133.215.123 - - [14/Jun/2014:10:30:13 -0400] "GET /home HTTP/1.1" 200 1671 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"

I am trying to excute this query which is not working

i have copied serde jar file in hdfs and when try to run this, does not work

I am new to this, the below code works fine in cloudera hive, but not here.
is there any otherway to accomplish this,
please Note : I am very new to this so please explain simple step by step approch, thanks
ADD JAR /tmp/hive-json-serde.jar
CREATE EXTERNAL TABLE t1 (
    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';



0 REPLIES 0