代码之家  ›  专栏  ›  技术社区  ›  Ellen Spertus

如何对烫伤中的TypedPipe元素进行排序?

  •  4
  • Ellen Spertus  · 技术社区  · 7 年前

    TypedPipe 在烫伤中(当不执行 group 操作)。以下是我的程序的相关部分(用省略号替换不相关的部分):

      case class ReduceOutput(val slug : String,  score : Int, json1 : String, json2 : String)
    
      val pipe1 : TypedPipe[(String, ReduceFeatures)] = ...
      val pipe2 : TypedPipe[(String, ReduceFeatures)] = ...    
      pipe1.join(pipe2).map { entry =>
        val (slug : String, (features1 : ReduceFeatures, features2 : ReduceFeatures)) = entry
        new ReduceOutput(
          slug,
          computeScore(features1, features2),
          features1.json,
          features2.json)
      }
        .write(TypedTsv[ReduceOutput](args("output")))
    

    是否有方法对其上的元素进行排序 score 之后 map 但在 write

    0 回复  |  直到 7 年前
    推荐文章