小弟初學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命令同樣報以上錯誤,求大仙指點!!!
已經解決了,是mysql的版本和驅動的版本不匹配導致的,我的mysql版本是5.6的,剛開始使用的驅動是5.1.18,這個版本還支持SQL_SELECT_LIMIT參數,但是mysql5.6已經拋棄了這個參數,所以會報上面錯誤,換成驅動5.1.26後解決。