acrites commented on code in PR #37691:
URL: https://github.com/apache/beam/pull/37691#discussion_r2933852846
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/IterableSideInput.java:
##########
@@ -40,17 +41,23 @@ public IterableSideInput(
BeamFnStateClient beamFnStateClient,
String instructionId,
StateKey stateKey,
- Coder<T> valueCoder) {
+ Coder<T> valueCoder,
+ boolean hasNoState) {
checkArgument(
stateKey.hasIterableSideInput(),
"Expected IterableSideInput StateKey but received %s.",
stateKey);
this.values =
- StateFetchingIterators.readAllAndDecodeStartingFrom(
- cache,
- beamFnStateClient,
-
StateRequest.newBuilder().setInstructionId(instructionId).setStateKey(stateKey).build(),
- valueCoder);
+ hasNoState
Review Comment:
It surprises me that this works. Doesn't this mean for batch pipelines
trying to call `get()` on a side input will always return an empty set? It
looks like in the IterableSideINputTest.java below, we're setting `hasNoState`
to false, so that's probably why the tests are passing. But in
FnApiStateAccessor, we're potentially setting it to true.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]