Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Explorer

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

avatar
Expert 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]

View solution in original post

6 REPLIES 6

avatar
Champion

does your

set hive.variable.substitute=true;

script has this line inserted ? 

 

avatar
Explorer

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)

 

avatar
Expert 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]

avatar
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

 

 

avatar
Explorer

Hi @csguna ,

 

set hive.variable.substitute=true;

 

Could you share what is the purpose inserting this line to the code? 

Thanks.

avatar
Community Manager

@newbieone, as this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post.



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: