首页 > 数据库 >MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at

MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at

时间:2023-06-06 19:34:00浏览次数:63  
标签:use right java OPTION hadoop hive metastore apache org


hive删除表时报错如下:

hive> drop table aaa;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 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
        at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:451)
        at org.datanucleus.api.jdo.JDOPersistenceManager.getDataStoreConnection(JDOPersistenceManager.java:2259)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.trySetAnsiQuotesForMysql(MetaStoreDirectSql.java:166)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:107)
        at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:252)
        at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:223)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:497)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:475)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table(HiveMetaStore.java:1558)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105)
        at com.sun.proxy.$Proxy1.get_table(Unknown Source)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table.getResult(ThriftHiveMetastore.java:8146)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table.getResult(ThriftHiveMetastore.java:8130)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at org.apache.hadoop.hive.metastore.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:48)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
NestedThrowablesStackTrace:
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
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
        at com.mysql.jdbc.StatementImpl.executeSimpleNonQuery(StatementImpl.java:1544)
        at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
        at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3214)
        at com.jolbox.bonecp.ConnectionHandle.getTransactionIsolation(ConnectionHandle.java:825)
        at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:444)
        at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getXAResource(ConnectionFactoryImpl.java:378)
        at org.datanucleus.store.connection.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:328)
        at org.datanucleus.store.connection.AbstractConnectionFactory.getConnection(AbstractConnectionFactory.java:94)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.getNucleusConnection(RDBMSStoreManager.java:1357)
        at org.datanucleus.api.jdo.JDOPersistenceManager.getDataStoreConnection(JDOPersistenceManager.java:2245)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.trySetAnsiQuotesForMysql(MetaStoreDirectSql.java:166)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:107)
        at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:252)
        at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:223)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:58)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:497)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:475)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table(HiveMetaStore.java:1558)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105)
        at com.sun.proxy.$Proxy1.get_table(Unknown Source)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table.getResult(ThriftHiveMetastore.java:8146)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table.getResult(ThriftHiveMetastore.java:8130)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at org.apache.hadoop.hive.metastore.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:48)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

解决办法:
是mysql的版本和驱动的版本不匹配导致的,我的mysql版本是5.6的,刚开始使用的驱动是5.1.18,
,但是mysql5.6已经抛弃了这个参数,所以会报上面错误,换成驱动mysql-connector-java-5.1.31-bin.jar后解决。
下载驱动:
http://dev.mysql.com/downloads/connector/j/ 选择平台,下载(mysql-connector-java-5.1.31.tar.gz)
下载后解压
tar -xvf mysql-connector-java-5.1.31.tar 
cd mysql-connector-java-5.1.31
cp mysql-connector-java-5.1.31-bin.jar  /usr/local/hive/lib/



重启服务:
[root@db96 ~]# hive --service metastore -hiveconf hbase.zookeeper.quorum=db96,db98,db99  -hiveconf hbase.zookeepeproperty.clientPort=2181
[root@db96 ~]# hive --service hiveserver -hiveconf hbase.zookeeper.quorum=db96,db98,db99 -hiveconf hbase.zookeepeproperty.clientPort=2181


进入Hive 删除成功。
hive> drop table aaa;
OK
Time taken: 2.751 seconds

标签:use,right,java,OPTION,hadoop,hive,metastore,apache,org
From: https://blog.51cto.com/u_16152230/6427064

相关文章

  • 浅谈 ByteHouse Projection 优化实践
    预聚合是OLAP系统中常用的一种优化手段,在通过在加载数据时就进行部分聚合计算,生成聚合后的中间表或视图,从而在查询时直接使用这些预先计算好的聚合结果,提高查询性能,实现这种预聚合方法大多都使用物化视图来实现。Clickhouse社区实现的Projection功能类似于物化视图,原始的概念......
  • Playwright微软自动化框架-对浏览器的操作-页面前进/后退/刷新操作
    昨天使用微软自动化框架Playwright对浏览器进行全屏显示,多个浏览器调用等功能,今天我们来对浏览器进行前进/后退/刷新等操作。  直接上代码:  package org.example;import com.microsoft.playwright.*;publicclass BrowserFresh{  publicstaticvoid main(String[]......
  • 【HarmonyOS】关于 Caused by java.lang.IllegalStateException The specified...
    【问题描述】线上收到大量手机的崩溃异常,以华为手机为主,崩溃如下1.Causedby:java.lang.IllegalStateException:Thespecifiedmessagequeuesynchronizationbarriertokenhasnotbeenpostedorhasalreadybeenremoved.2.atandroid.os.MessageQueue.removeSyncBarri......
  • mysql版本:'for the right syntax to use near 'identified by 'password' with grant
    查询mysql具体版本SELECT@@VERSION问题分析:mysql版本8.0.13,在给新用户授权时,发生了变化:1064-YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfortherightsyntaxtousenear'identifiedby'password'withgrant......
  • 使用fake-useragent自动更换UserAgent
    安装:pipinstallfake-useragent使用:fromfake_useragentimportUserAgentif__name__=='__main__':agent__random=UserAgent().randomprint(str(agent__random))如果报错:fake_useragent.errors.FakeUserAgentError本地UserAgent和远程UserAgent不一致导致,同步一下......
  • opensuse安装报错
    用u盘安装opensuse时,报错:YaST2Cannotaccessinstallationmediahd:/?device=/dev/disk/by-id/usb-xxx-part1hd-xxx(Medium1).Checkwhethertheserverisaccessible.是因为烧录启动盘时,不知什么原因,有些文件没有拷贝全,可以挂载opensuse的ios,然后把所有文件拷贝到u盘,跳......
  • const { t } = useI18n();不能在setup外执行
    传递函数constchartOptions=(t:Function,color:string="warning",height:string="auto"):ApexOptions=>{return{//Restofyourchartoptionscategories:[t("Totalnumber"),t("normal"),&......
  • User-Agent特征库
    User-Agent特征库爬行特征库(CRAWLERS)008ABACHOBotAccoona-AI-AgentAddSugarSpiderBotAnyApexBotArachmoB-l-i-t-z-B-O-TBaiduspiderBecomeBotBeslistBotBillyBobBotBimbotBingbotBlitzBOTboitho.com-dcboitho.com-robotbtbotCatchBotCerberianDrtrsCharlott......
  • pnpm:无法加载文件 C:\Users\Five\AppData\Roaming\npm\pnpm.ps1 ,因为在此系统
    前言重装完了电脑系统,运行pnpm无法加载文件,pnpm-V也不行解决方案用管理员方式启动powershell输入命令:set-ExecutionPolicyRemoteSigned然后再输入:Y重启代码编辑器 ......
  • 微软Playwright-UI自动化中常用方法总结-java
    经过多天对微软自动化框架Playwright的使用,发现还没有讲该框架的常用方法,比如定位、按键等操作使用。今天我们正好来说说。  一、鼠标类操作     1.单点      .click();   click(Stringselector){                          ......