首页 > 其他 > 详细

学习Hive遇到的问题

时间:2020-10-08 18:27:10      阅读:26      评论:0      收藏:0      [点我收藏+]

学习Hive遇到的问题

配置了mysql为元数据库后,然后新建了一个表test(id int,name string)
hive> show tables;
OK
test
Time taken: 1.759 seconds
hive> drop table test;
FAILED: Error in metadata: MetaException(message:javax.jdo.JDODataStoreException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OPTION SQL_SELECT_LIMIT=DEFAULT‘ at line 1
NestedThrowables:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OPTION SQL_SELECT_LIMIT=DEFAULT‘ at line 1)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
然后再执行show tables命令同样报以上错误

同样在执行其他语句是会显示使得已经存在的表会提示不存在

还有

技术分享图片

Error: Error while compiling statement: FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: MetaExcepttax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OPTION SQL_SELECT_LIMIT=
0: jdbc:hive2://hadoop-11:10000> show tables;

解决:

  • mysql的版本和驱动的版本不匹配导致的,我的mysql版本是5.7的,刚开始使用的驱动是5.1.17,这个版本还支持SQL_SELECT_LIMIT参数,但是mysql5.7已经抛弃了这个参数,所以会报上面错误,换成驱动5.1.39后解决。
  • 如是在阿里云上搭建的hive出现同样的问题则要在 修改cm元数据库那个步骤上将/usr/share/java 下的驱动更换。

学习Hive遇到的问题

原文:https://www.cnblogs.com/yyb6/p/13782047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!