SparkContext读取GBK格式的文件

sparkContext.hadoopFile(args(0),classOf[TextInputFormat], classOf[LongWritable], classOf[Text], 1)
      .map(p => new String(p._2.getBytes, 0, p._2.getLength, "GBK"))
      .map(_.split("#"))
posted @ 2020-11-03 11:48  亮剑-胜哥  阅读(162)  评论(0)    收藏  举报