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.

Tutorial Exercise 3

Tutorial Exercise 3

New Contributor

Hello I am workig on the exercise 3

 

See query below

 

I completed all previus step with upstanding results but when I run these queries the folowing error is shown:

Error while compiling statement: FAILED: ParseException line 11:5 cannot recognize input near 'FORMAT' 'SERDE' ''org.apache.hadoop.hive.contrib.serde2.RegexSerDe'' in column type

 

I review the query many times

Any help will be highly appreciated

 

Thank you in advance

 

0: jdbc:hive2://quickstart:10000/default> 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';

0: jdbc:hive2://quickstart:10000/default> 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';

0: jdbc:hive2://quickstart:10000/default> ADD JAR /usr/lib/hive/lib/hive-contrib.jar;

0: jdbc:hive2://quickstart:10000/default> INSERT OVERWRITE TABLE tokenized_access_logs SELECT * FROM intermediate_access_logs;

0: jdbc:hive2://quickstart:10000/default> !quit

 

1 REPLY 1

Re: Tutorial Exercise 3

New Contributor

I notice in my terminal screen the connection with JDBC:HIVE 2 show <closed>

0: jdbc:hive2://quickstart:10000/default (closed) >
I tried to restart it using:
sudo service hive-server2 restart
but I did not see any changed

Any help please?

Regards.