SparkSql连接hive表出现的问题

  1. User class threw exception: org.apache.spark.sql.AnalysisException: Table not found
    在代码中添加:
    hiveContext.setConf("hive.metastore.uris", "thrift://node1:9083")

  2. User class threw exception: class not found : com.mysql.jdbc.driver
    检查代码中的类名:com.mysql.jdbc.Driver

  3. Spark中额外的第三方类:
    可以在spark-default.conf文件中添加:spark.driver.extraClassPath=/etc/spark/external_jars spark.executor.extraClassPath=/etc/spark/external_jars
    然后将常用的jar包拷贝进去,每个节点都需要拷贝

你可能感兴趣的:(大数据学习)