) 빔 google 데이터 흐름 파이프 라인 예제 중 하나를 시도하고 있지만 MapElements 및 메소드 SingleFunction/SerializableFunction 호출과 관련하여 예외가 발생합니다. 코드 조각은 다음과 같다 : 점에서Apache beam Dataflow SDK 오류 (예 :
static class ParseTableRowJson extends SimpleFunction<String, TableRow> {
@Override
public TableRow apply(String input) {
try {
return Transport.getJsonFactory().fromString(input, TableRow.class);
} catch (IOException e) {
throw new RuntimeException("Failed parsing table row json", e);
}
}
}
......
p.apply(TextIO.read().from(options.getInput()))
.apply(MapElements.via(new ParseTableRowJson()))
.apply(new ComputeTopSessions(samplingThreshold))
.apply("Write",
TextIO.write().withoutSharding().to(options.getOutput()));
예외의 방법에 모호한 전화 :
Ambiguous method call. Both
via (SimpleFunction<String, TableRow>) in MapElements and
via (SerializableFunction) in MapElements match
다른 사람이 같은 예외로 충돌하고 주위에 방법이있어 했습니까?
전체 예제는 github (https://github.com/apache/beam/blob/master/examples/java/src/main/java/org/apache/beam/examples/complete/TopWikipediaSessions.java)입니다. 이 보인다
감사합니다,
페르난도
안녕하세요 Ben, 답장을 보내 주셔서 감사합니다. MapElements를 DoFn으로 변환하는 과정이 끝났습니다. –