spark 压缩解压文件(基于scala)

  def writerCompression(): Unit = {
    val fs = FileSystem.get(new Configuration())
    val outFile = fs.create(new Path("test.lz4"))
    val ccf = new CompressionCodecFactory(new Configuration())
    val codec = ccf.getCodecByName("lz4")
    val compressOutStream = codec.createOutputStream(outFile)
    compressOutStream.write("1111test".getBytes())
    compressOutStream.close()
  }

你可能感兴趣的:(spark,scala)