I am using spark 1.4 and trying to save as orcfile with compression snappy but it saves as zlib

安稳与你 提交于 2020-01-06 14:50:46

问题


here is my code:

val df=hiveContext.write.format("orc").options("orc.compression","SNAPPY").save(
"xyz")

but file is saved as ZLIB.


回答1:


You could try adding the extra conf "spark.io.compression.codec=snappy" to spark-shell / spark-submit:

spark-shell --conf spark.io.compression.codec=snappy #rest of your command..

Also, for writing to ORC format (assuming you are in Spark >= 1.5) you can use:

myDf.orc("/some/path")

The "orc" method is exactly like doing '.format("orc").save("/some/path")'.



来源:https://stackoverflow.com/questions/33464990/i-am-using-spark-1-4-and-trying-to-save-as-orcfile-with-compression-snappy-but-i

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!