johnyangk closed pull request #121: [NEMO-218] Throws exception while
processing non-keyed events in CreateViewTransform
URL: https://github.com/apache/incubator-nemo/pull/121
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/CreateViewTransform.java
b/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/CreateViewTransform.java
index d4aa1951b..cd9329657 100644
---
a/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/CreateViewTransform.java
+++
b/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/transform/CreateViewTransform.java
@@ -55,10 +55,8 @@ public void prepare(final Context context, final
OutputCollector<O> oc) {
@Override
public void onData(final I element) {
// Since CreateViewTransform takes KV(Void, value), this is okay
- if (element instanceof KV) {
- final KV<?, ?> kv = (KV<?, ?>) element;
- multiView.getDataList().add(kv.getValue());
- }
+ final KV<?, ?> kv = (KV<?, ?>) element; // It will throw a type cast
exception if the element is not KV
+ multiView.getDataList().add(kv.getValue());
}
@Override
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services