【发布时间】:2017-06-05 00:52:40
【问题描述】:
我正在使用 Spark 1.6 (Cloudera 5.8.2) 并尝试了以下方法来配置 ORC 属性。但不影响输出。
下面是我试过的代码sn-p。
DataFrame dataframe =
hiveContext.createDataFrame(rowData, schema);
dataframe.write().format("orc").options(new HashMap(){
{
put("orc.compress","SNAPPY");
put("hive.exec.orc.default.compress","SNAPPY");
put("orc.compress.size","524288");
put("hive.exec.orc.default.buffer.size","524288");
put("hive.exec.orc.compression.strategy", "COMPRESSION");
}
}).save("spark_orc_output");
除此之外,我还尝试了在 hive-site.xml 和 hiveContext 对象中设置的这些属性。
输出中的 hive --orcfiledump 确认未应用配置。 Orcfiledump sn -p 如下。
Compression: ZLIB
Compression size: 262144
【问题讨论】:
标签: java hadoop apache-spark hive cloudera