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.

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

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

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.

 

 

6 REPLIES 6

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

New Contributor

Hello everyone.

 

I'm think you try enter a query in impala module, but you must use hive.

 

With best regards.

@td_mulga

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

Explorer

I am doing this in Impala Query Editor (I think the tutorial tells us to do that), yet I got this same error message.

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

Contributor

Pretty certain it says to use the Hive Query Editor for this portion. You'll use the Impala Query Editor later.

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

Master Collaborator
Are you sure you're entering that query in the Hive Query Editor? This
stage uses some features of Hive that do not work in Impala. Other parts of
the tutorial (namely querying the data once it's ETL'd) do require the
Impala Query Editor so it's easy to get those mixed up.

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

New Contributor

Dear I executed it on Hive Editor but I recieved the following Message

 

"Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:hdfs://quickstart.cloudera:8020/user/hive/warehouse/original_access_logs is not a directory or unable to create one)"

 

any comment or help on that??

Highlighted

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

New Contributor

Any one got solution for this problem i.e. to fix this error?

Don't have an account?
Coming from Hortonworks? Activate your account here