3
データフローパイプラインのサイド入力としてHashMapを渡そうとしています。私はString、Int、Longのいずれかを渡す少数を除いて例を見つけることができません。私のコード:データフローのサイド入力としてHashMapを渡す方法
tagList = pipeline.apply(TextIO.Read.named("tagListTextRead").from("gs://mybucket/tag-list.json"));
PCollection<Map<String,TagObject>> tagMap = tagList
.apply(ParDo.named("allTagsToTagMap").of(new Tags.BuildTagListMapFn()));
PCollectionView<Map<String, TagObject>> tagMapView =
allTags.apply(View.<String, TagObject>asMap());
3番目のステートメントは構文エラーです。
The method apply(PTransform<? super PCollection<Map<String,TagObject>>,OutputT>) in the type
PCollection<Map<String,TagObject>> is not applicable for the arguments
(View.AsMap<String,TagObject>)
データフローパイプラインのサイド入力としてHashMapを渡す方法を教えてもらえますか。
感謝。これは私のために働いた。私のケースは#2だったので、asSingletonを使うことは私が必要としていたものでした。 –