我想在spark-sql中使用BZip2编解码器压缩从DataFrame编写镶木地板文件,以便它们可以拆分 . 使用以下代码,我可以使用snappy和gzip等编解码器:

sqlContext.setConf("spark.sql.parquet.compression.codec", "snappy")
sqlContext.read.parquet(stagingDir)
        .dropDuplicates()
        .write
        .mode(SaveMode.Append)
        .parquet(outputDir)

但是,当我尝试使用BZip2时,它看起来不可用,因为我得到了这个异常,即使我能够从RDD写入BZip2压缩文本文件

java.lang.IllegalArgumentException: The value of spark.sql.parquet.compression.codec should be one of uncompressed, snappy, gzip, lzo, but was bzip2

有没有办法从Spark SQL编写BZip2压缩镶木地板文件?