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. Want to know more about what has changed? Check out the Community News blog.

Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

SOLVED Go to solution

Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

New Contributor

Dear Support,

 

 

I get a problem upgrading CDH from 5.9.1 to 5.9.3
The shells on CDH 5.9.1 are going well, but on CDH 5.9.3 show errors.
Here are the examples.

CASE 1.
[root@tcrmmn1 SH]# cat test.hql
insert into default.sample_07
--test
select * from default.sample_07 limit 10
;
[root@tcrmmn1 SH]# ./test9_nok.sh
insert into default.sample_07
--test
select * from default.sample_07 limit 10
;
Error: Error while compiling statement: FAILED: ParseException line 1:29 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in statement (state=42000,code=40000)
[root@tcrmmn1 SH]# cat test9_nok.sh
#!/bin/bash

value=`cat test.hql`
echo "$value"

beeline -u jdbc:hive2://10.1.9.5:10000/default?characterEncoding=UTF-8 -n hive -p 1qaz@WSX3edc --verbose=false --showHeader=false --silent=true --outputformat=tsv2 -e "$value"

 

CASE 2.
[root@tcrmmn1 SH]# ./test7_nok.sh
insert into default.sample_07
--test
select * from default.sample_07 limit 10
;

Error: Error while compiling statement: FAILED: ParseException line 1:29 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in statement (state=42000,code=40000)
[root@tcrmmn1 SH]# cat test7_nok.sh
#!/bin/bash

V_SQL=\
"insert into default.sample_07
--test
select * from default.sample_07 limit 10
;
"
echo "${V_SQL}"

beeline -u jdbc:hive2://10.1.9.5:10000/default?characterEncoding=UTF-8 -n hive -p 1qaz@WSX3edc --verbose=false --showHeader=false --silent=true --outputformat=tsv2 -e "${V_SQL}"

 

I also try the option -f. It's fine. Excute Sucessfuly.

[root@tcrmmn1 SH]# cat test10_ok.sh
#!/bin/bash

value=`cat test.hql`
echo "$value"

beeline -u jdbc:hive2://10.1.9.5:10000/default?characterEncoding=UTF-8 -n hive -p 1qaz@WSX3edc --verbose=false --showHeader=false --silent=true --outputformat=tsv2 -f test.hql

 

How can I fix it without modifying shell file?

 

Thank you!

 

Best Regards,

Ping

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

Contributor

This regression was introduced into the product in CDH 5.9.2 [HIVE-13864] and it was addressed in CDH 5.11.2, CDH 5.12.1 or CDH 5.13.0 and higher. [HIVE-17050]

4 REPLIES 4

Re: Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

Champion

does your

set hive.variable.substitute=true;

script has this line inserted ? 

 

Re: Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

New Contributor

Thanks for replying

 

I add the property to the script.

 

beeline -u jdbc:hive2://10.7.2.111:10000/default?characterEncoding=UTF-8 -n hive -p 1qaz@WSX3edc --hiveconf hive.variable.substitute=true --verbose=false --showHeader=false --silent=true --outputformat=tsv2 -e "$value"

 

The result is the same.

Error: Error while compiling statement: FAILED: ParseException line 1:29 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in statement (state=42000,code=40000)

 

Re: Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

Contributor

This regression was introduced into the product in CDH 5.9.2 [HIVE-13864] and it was addressed in CDH 5.11.2, CDH 5.12.1 or CDH 5.13.0 and higher. [HIVE-17050]

Highlighted

Re: Compiling statement: FAILED: ParseException : cannot recognize input near '<EOF>

Explorer

Hi,

 

I have exactly the issue described in this post and I am running CDH 5.13.3

 

I have tried putting this in the hql script as mentioned above:

set hive.variable.substitute=true;

and that does not help either.

 

Can someone advise what to try ?

 

Thanks