在我的 hive on spark 作业中,出现此错误:
org.apache.spark.shuffle.MetadataFetchFailedException:缺少 shuffle 0 的输出位置
感谢您的回答 (Why do Spark jobs fail with org.apache.spark.shuffle.MetadataFetchFailedException: Missing an output location for shuffle 0 in speculation mode?),我知道这可能是我的 hiveonspark 作业有同样的问题
由于 hive 将 sql 转换为 hiveonspark 作业,我不知道如何在 hive 中设置它以使其 hiveonspark 作业从 StorageLevel.MEMORY_ONLY 更改为 StorageLevel.MEMORY_AND_DISK?
谢谢你的帮助~~~~
最佳答案
您可以使用 CACHE/UNCACHE [LAZY] Table <table_name>
管理缓存。 More details .
如果您使用的是 DataFrame,那么您可以使用 persist(...) 来指定 StorageLevel。看API here. .
除了设置存储级别外,您还可以优化其他内容。 SparkSQL 使用一种称为列存储的不同缓存机制,这是一种更有效的缓存数据方式(因为 SparkSQL 是模式感知的)。如 detail here (THis is latest version documentation. Refer to the documentation of version you are using). 中所述,可以调整不同的配置属性集来管理缓存。
- spark.sql.inMemoryColumnarStorage.compressed
- spark.sql.inMemoryColumnarStorage.batchSize
关于hadoop - 如何在 spark 上的 hive 中设置 spark RDD StorageLevel?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34823218/