大佬教程收集整理的这篇文章主要介绍了使用 spark 删除 hive 数据库时发生 AnalysisException 环境问题示例,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
spark.sql(f"CREATE DATABASE IF NOT EXISTS myDb LOCATION 'shared-metastore-LOCATIOn/myDb.db'")
################
# DB creation succeeds and I can vIEw the db in the metastore,add tables etc
################
spark.sql(f"DROP DATABASE myDb CASCADE")
################
AnalysisException: 'org.apache.hadoop.hive.ql.Metadata.HiveException: MetaException(message:Unable to clean up java.sql.sqlException: The table does not comply with the requirements by an external plugin.\n\tat com.Mysql.cj.jdbc.exceptions.sqlError.createsqlException(sqlError.java:129)\n\tat com.Mysql.cj.jdbc.exceptions.sqlError.createsqlException(sqlError.java:97)\n\tat com.Mysql.cj.jdbc.exceptions.sqlExceptionsmapPing.translateException(sqlExceptionsmapPing.java:122)\n\tat com.Mysql.cj.jdbc.StatementImpl.executeupdateInternal(StatementImpl.java:1335)\n\tat com.Mysql.cj.jdbc.StatementImpl.executeLargeupdate(StatementImpl.java:2108)\n\tat com.Mysql.cj.jdbc.StatementImpl.executeupdate(StatementImpl.java:1245)\n\tat com.zaxxer.hikari.pool.ProxyStatement.executeupdate(ProxyStatement.java:117)\n\tat com.zaxxer.hikari.pool.HikariProxyStatement.executeupdate(HikariProxyStatement.java)\n\tat org.apache.hadoop.hive.metastore.txn.TxnHandler.cleanupRecords(TxnHandler.java:2741)\n\tat org.apache.hadoop.hive.metastore.AcIDEventlistener.onDroPDAtabase(AcIDEventListener.java:52)\n\tat org.apache.hadoop.hive.metastore.metastoreListenerNotifIEr$21.notify(metastoreListenerNotifIEr.java:85)\n\tat org.apache.hadoop.hive.metastore.metastoreListenerNotifIEr.notifyEvent(metastoreListenerNotifIEr.java:264)\n\tat org.apache.hadoop.hive.metastore.metastoreListenerNotifIEr.notifyEvent(metastoreListenerNotifIEr.java:326)\n\tat org.apache.hadoop.hive.metastore.metastoreListenerNotifIEr.notifyEvent(metastoreListenerNotifIEr.java:364)\n\tat org.apache.hadoop.hive.metastore.Hivemetastore$HMSHandler.drop_database_core(Hivemetastore.java:1537)\n\tat org.apache.hadoop.hive.metastore.Hivemetastore$HMSHandler.drop_database(Hivemetastore.java:1575)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegaTingMethodAccessorImpl.invoke(DelegaTingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.apache.hadoop.hive.metastore.retryingHMSHandler.invokeInternal(retryingHMSHandler.java:147)\n\tat org.apache.hadoop.hive.metastore.retryingHMSHandler.invoke(retryingHMSHandler.java:108)\n\tat com.sun.proxy.$Proxy32.drop_database(UnkNown sourcE)\n\tat org.apache.hadoop.hive.metastore.API.ThriftHivemetastore$Processor$drop_database.getResult(ThriftHivemetastore.java:14352)\n\tat org.apache.hadoop.hive.metastore.API.ThriftHivemetastore$Processor$drop_database.getResult(ThriftHivemetastore.java:14336)\n\tat org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)\n\tat org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:111)\n\tat org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:107)\n\tat java.security.AccessController.doprivileged(Native Method)\n\tat javax.security.auth.Subject.doAs(Subject.java:422)\n\tat org.apache.hadoop.security.UserGroupinformation.doAs(UserGroupinformation.java:1730)\n\tat org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:119)\n\tat org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n);'
尽管出现异常,但在我运行此代码后,数据库确实消失了。如果我尝试第二次运行 drop 命令,我会收到一个不同的异常,指出数据库不存在。但是,我不知道这次行动是完全成功了,还是留下了一团糟。我对 Hive 不够熟悉,不知道应该在 metastore 中删除什么才能完全删除一个 db
无论我在数据库中是否有表,我似乎都得到了相同的结果。我也试过在没有级联的情况下放下桌子。相同的结果
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的使用 spark 删除 hive 数据库时发生 AnalysisException 环境问题示例全部内容,希望文章能够帮你解决使用 spark 删除 hive 数据库时发生 AnalysisException 环境问题示例所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。