Reply
New Contributor
Posts: 4
Registered: ‎12-30-2016

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

[ Edited ]

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

 

Highlighted
Champion
Posts: 680
Registered: ‎05-16-2016

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

does your

set hive.variable.substitute=true;

script has this line inserted ? 

 

New Contributor
Posts: 4
Registered: ‎12-30-2016

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

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)

 

Announcements