Welcome to the Cloudera Community

Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Who agreed with this topic

Cloudera Live Tutorial Exercise 2 - Get ERROR: AnalysisException: Syntax error in line 3:

avatar
New Contributor

I getting the following error in Exercie 2 in the section "Correlate Structured Data with Unstructured Data" -  AnalysisException: Syntax error in line 3: date STRING, ^ Encountered: DATE Expected: IDENTIFIER CAUSED BY: Exception: Syntax error in the create table SQL:

 

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';

 

If I delete line 3 assigning date fiield to data type STRING, I get another error:

 

AnalysisException: Syntax error in line 10: ROW FORMAT SERDE 'org.apache.hadoop.hiv... ^ Encountered: IDENTIFIER Expected: DELIMITED CAUSED BY: Exception: Syntax error

 

How should I change the query to fix these errors.  I just downloaded Cloudera Live this week so should have the newest verions of all the software.

 

 

Who agreed with this topic