Skip to content

Commit 7606f07

Browse files
committed
Revert "testing-only: use read and error when mismatched"
This reverts commit 86c5007.
1 parent 1e2d96d commit 7606f07

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/python/streaming/TransformWithStateInPySparkStateServer.scala

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,22 @@ class TransformWithStateInPySparkStateServer(
208208
private def parseProtoMessage(): StateRequest = {
209209
val messageLen = inputStream.readInt()
210210
val messageBytes = new Array[Byte](messageLen)
211-
val readBytes = inputStream.read(messageBytes)
212211
// inputStream.readFully(messageBytes)
213-
// val readBytes = messageLen
212+
// inputStream.read(messageBytes)
213+
// /*
214+
val readBytes = inputStream.read(messageBytes)
214215
if (readBytes != messageLen) {
215216
throw new Exception(s"TESTING: Failed to read message bytes: expected $messageLen bytes, " +
216217
s"but only read $readBytes bytes")
217218
}
218-
219+
/*
220+
else if (messageLen > 500) {
221+
val debug = StateRequest.parseFrom(ByteString.copyFrom(messageBytes))
222+
throw new Exception(s"Unexpectedly matched message length: $messageLen bytes, "
223+
// + s"debug: ${debug.toString}")
224+
)
225+
}
226+
*/
219227
StateRequest.parseFrom(ByteString.copyFrom(messageBytes))
220228
}
221229

0 commit comments

Comments
 (0)