zoukankan      html  css  js  c++  java
  • Spark-shell 报错:Failed to get database default, returning NoSuchObjectException

    Spark-shell 执行sql查询报错:
    20/08/24 15:33:59 WARN metastore.ObjectStore: Failed to get database default, returning NoSuchObjectException
    20/08/24 15:34:03 ERROR metastore.RetryingHMSHandler: AlreadyExistsException(message:Database default already exists)

    在百度搜了很多解决方案,一点用没有,fq 找到了解决办法:
    这个是因为没有在Spark配置hive的配置文件,把hive配置的hive-site.xml 文件拷贝到 spark 目录下即可

    > mv hive/conf/hive-site.xml  spark/conf/hive-site.xml
    

    这样就解决了。

    另外一个问题:
    报错:
    Caused by: java.lang.reflect.InvocationTargetException: org.datanucleus.exceptions.NucleusException: Attempt toinvoke the "BONECP" plugin to create a ConnectionPool gave an error : The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.

    这个问题从字面意思上很容易看到,是因为jdbc的driver连接不上,需要依赖 mysql-connector 的jar包。
    mysql-connector 这个jar包在 hive 的lib 目录下,spark 存放jia包的路径是在 jars目录下,
    所以执行:

    > mv hive/lib/mysql-connector-java-5.1.44-bin.jar  spark/jars/mysql-connector-java-5.1.44-bin.jar
    

    这样就可以了,然后再重启spark-shell,就可以正常查询hive里面的表了。

  • 相关阅读:
    s3c6410_uboot中的代码重定位(nand->sdram)
    s3c6410_uart初始化及读写
    6410裸机开发教程下载
    s3c6410_时钟初始化
    linux device model简述
    CentOS安装flash player插件
    实例分析ELF文件动态链接
    581. Shortest Unsorted Continuous Subarray
    221. Maximal Square
    95. Unique Binary Search Trees II
  • 原文地址:https://www.cnblogs.com/bigband/p/13558399.html
Copyright © 2011-2022 走看看