hive -e "show tables"提示cannot recognize input near 'show' '<EOF>' '<EOF>' in ddl statement
2013-06-05 23:44
405 查看
一、前言
项目需要,需要知道hive的支持的最大并发用户数目是否满足需求,因此,写了个小程序测试 ,方式是java调用命令行程序的方式进行。即:
[java] view
plaincopy
Process executor = Runtime.getRuntime().exec(command,env);
但是这样做面临一个问题,就是在命令行输入hive -e "show tables"一切正常,如下所示。
[plain] view
plaincopy
[niy@niy-computer /]$ hive -e "show tables"
Logging initialized using configuration in file:/home/niy/workspace1/hive/trunk/conf/hive-log4j.properties
Hive history file=/tmp/niy/hive_job_log_niy_201305201234_366682237.txt
OK
alter2
niytab
part_nowhitelist_test
part_whitelist_test
poke
poke1
poke3
raw
src_rc_concatenate_test
table1
table3
test_table
test_table_like
xx
Time taken: 6.217 seconds, Fetched: 14 row(s)
而采用java程序调用 命令行的方式 上面的command 的参数就是hive -e "show tables",则运行失败,提示
二 解决方案
提示 cannot recognize input near 'show' '<EOF>' '<EOF>' in ddl statement,即告知 show 以后的语句“ tables”没有读取成功,换成"show databases"可以发现错误依旧。调试发现程序 在运行到
[java] view
plaincopy
Process executor = Runtime.getRuntime().exec(command,env);
command 的值是hive -e "show tables",即交给hive 时是准确无误的,可以断定解析出错是hive 本身的问题。
由于时间有限,暂给出解决方案,采用hive -f 来避开该问题,至于这问题的正面解决方案以后有时间 再处理,初步感觉可能是hive 的bug。
首先将hive ql语句 写入 文件/home/niy/tmp.ql (.ql后缀)
采用hive -v -f /home/niy/tmp.ql
搞定。
三 总结
问题的解决有时不是兵来将挡,水来土埋的正面回应,也可以是采用迂回战术。
相关文章推荐
- hive -e "show tables"提示cannot recognize input near 'show' '<EOF>' '<EOF>' in ddl statement
- hive -e "show tables"提示cannot recognize input near 'show' '<EOF>' &#
- hive -e "show tables"提示cannot recognize input near 'show' '<EOF>' '<EOF>' in ddl statement
- FAILED: ParseException line mismatched input '<EOF>' expecting StringLiteral near 'by' in
- hive FAILED: ParseException line 1:814 cannot recognize input near ‘;’ <EOF>’
- hive 建表报错:ParseException - cannot recognize input near 'end' 'string'
- 最近的两个问题<input>与<frame src="/example/html/frame_a.html" name="showframe">
- IE11也不再支持document.createElement("<input type='file' name='upload'/>");
- inline javascript cannot have the string "</script>"
- <input type="text" value="">实现输入提示
- <input type="file" />浏览时只显示指定文件类型
- <input type="image"> 和 <img> 用法区别
- <c:if test="${empty(*)}"> 报错javax.el.ELException: Function ':empty' not found;
- Mysql登录提示1045 error:access denied for user 'root'@'localhost <using password: yes>
- <input type="button" style="display:none">隐藏按钮显示
- 'filename.h' file not found with <angled> include, use "quotes" instead. 问题详解
- <form>标签只能作用一个<input type="hidden"/>?
- 关于 '<a[^>]+href=["\'](.*?)["\']' 的解释
- YUM安装遇到问题:File"/usr/bin/yum", line 29, in <module> File"/usr/share/yum-cli/yummain.py", line 276, in
- struts2文件下载及 <param name="inputName">inputStream</param>的理解