本地snappy库不可用:此版本的libhadoop是在没有snappy支持的情况下构建的。

3
当我使用MLUtils saveAsLibSVMFile时,出现了上述错误。尝试了以下各种方法,但都没有成功。

  /*
   conf.set("spark.io.compression.codec","org.apache.spark.io.LZFCompressionCodec")
  */

  /*
  conf.set("spark.executor.extraClassPath","/usr/hdp/current/hadoop-client/lib/snappy-java-*.jar")
  conf.set("spark.driver.extraClassPath","/usr/hdp/current/hadoop-client/lib/snappy-java-*.jar")
  
    conf.set("spark.executor.extraLibraryPath","/usr/hdp/2.3.4.0-3485/hadoop/lib/native")
    conf.set("spark.driver.extraLibraryPath","/usr/hdp/2.3.4.0-3485/hadoop/lib/native")
  */

我阅读了以下链接:https://community.hortonworks.com/questions/18903/this-version-of-libhadoop-was-built-without-snappy.html
最终我只有两种解决方法,下面给出答案。
1个回答

2
  1. 一种方法是使用不同的Hadoop编解码器,例如下面这样: sc.hadoopConfiguration.set("mapreduce.output.fileoutputformat.compress", "true") sc.hadoopConfiguration.set("mapreduce.output.fileoutputformat.compress.type", CompressionType.BLOCK.toString) sc.hadoopConfiguration.set("mapreduce.output.fileoutputformat.compress.codec", "org.apache.hadoop.io.compress.BZip2Codec") sc.hadoopConfiguration.set("mapreduce.map.output.compress", "true") sc.hadoopConfiguration.set("mapreduce.map.output.compress.codec", "org.apache.hadoop.io.compress.BZip2Codec")

  2. 第二种方法是在我的spark-submit作业中作为参数提及--driver-library-path /usr/hdp/<whatever is your current version>/hadoop/lib/native/(在命令行中)。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接