【问题标题】:Increase container size and application master memory in HiveWarehouseSession在 HiveWarehouseSession 中增加容器大小和应用程序主内存
【发布时间】:2020-08-30 23:14:41
【问题描述】:

我们能否通过 Spark 中的 HiveWarehouseSession 增加 tez 容器大小和应用程序主内存。

属性:-

tez.am.resource.memory.mb hive.tez.container.size

示例代码

from pyspark_llap import HiveWarehouseSession
hive = HiveWarehouseSession.session(spark).build()
hive.setDatabase("sample_db")
hive.executeQuery("select abc from sample")

【问题讨论】:

    标签: apache-spark pyspark hive apache-spark-sql hiveql


    【解决方案1】:

    是的,你可以做到,下面是如何在 spark 中做到这一点,

    from pyspark_llap import HiveWarehouseSession
    hive = HiveWarehouseSession.session(spark).build()
    hive.setDatabase("sample_db")
    hive.executeQuery("SET tez.am.resource.memory.mb=1024")
    hive.executeQuery("SET hive.tez.container.size=3072")
    hive.executeQuery("SELECT abc FROM sample")
    

    【讨论】:

    • 不通过 SqlContext 或 sparkSession。我的源是一个桶表,所以我正在通过 HiveWarehouseSession 阅读。如下from pyspark_llap import HiveWarehouseSessionhive = HiveWarehouseSession.session(spark).build()hive.setDatabase("sample_db")hive.executeQuery("select abc from sample")
    • 原始问题只是设置提到的配置单元属性,而不是这个。使用正确的内容编辑您的问题。
    • 我在标题中已经通过 HiveWarehouseSession 提到过。根据您的要求更新了示例代码。
    • 抛出解析异常。堆栈跟踪:ERROR HiveWarehouseDataSourceReader: Unable to read table schema File "/usr/hdp/current/spark2-client/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py", line 328, in get_return_value py4j.protocol.Py4JJavaError: An error occurred while calling o95.executeQuery. : java.lang.RuntimeException: shadehive.org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.parse.ParseException: line 1:4 cannot recognize input near 'SET' 'tez' '.' in statement
    猜你喜欢
    • 2012-03-25
    • 2011-03-03
    • 2013-04-16
    • 2013-02-14
    • 2020-04-23
    • 1970-01-01
    • 2021-02-06
    相关资源
    最近更新 更多