【问题标题】:In AWS EMR, From Jupyter, pyspark's hive enabled spark session is only showing default database and not all hive databases在 AWS EMR 中,来自 Jupyter 的 pyspark 启用 hive 的 spark 会话仅显示默认数据库,而不是所有 hive 数据库
【发布时间】:2021-07-01 07:00:31
【问题描述】:

已在 AWS EMR 中安装了 jupyter。 以下代码在非 AWS 环境中运行良好,但在 AWS EMR 中,jupyter 仅在 Hive 中显示默认数据库。 从 Hive shell,显示数据库我看到 6 个数据库,但从 jupyter 它只显示默认值。 在非 AWS 集群中显示为 6。

from pyspark.sql import SparkSession
spark = SparkSession \
    .builder \
    .appName("Python Spark SQL Hive integration example") \
    .enableHiveSupport() \
    .getOrCreate()

 display(spark.sql('show databases').show())

+----------+ |命名空间| +----------+ |默认| +---------+

火花

SparkSession - 蜂巢

SparkContext

火花用户界面

版本 v3.0.1 掌握 当地的 应用名称 Python Spark SQL Hive 集成示例

【问题讨论】:

    标签: pyspark jupyter-notebook amazon-emr


    【解决方案1】:
    settings = [
            ("hive.metastore.uris", "thrift://xxxxx")  #from /etc/hive/conf/hive-site.xml
            ] 
    spark_conf = SparkConf().setAppName("Python Spark SQL Hive integration example").setAll(settings)
    spark = SparkSession.builder. \
        config(conf = spark_conf). \
        enableHiveSupport(). \
        getOrCreate()
    

    【讨论】:

      猜你喜欢
      • 2018-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多