bersprockets commented on a change in pull request #35368:
URL: https://github.com/apache/spark/pull/35368#discussion_r795266104
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationExec.scala
##########
@@ -78,13 +78,17 @@ private[hive] case class HiveScriptTransformationExec(
lazy val unwrappers =
outputSoi.getAllStructFieldRefs.asScala.map(unwrapperFor)
override def hasNext: Boolean = {
+ if (completed) {
+ return false
+ }
try {
if (scriptOutputWritable == null) {
scriptOutputWritable = reusedWritableObject
if (scriptOutputReader != null) {
if (scriptOutputReader.next(scriptOutputWritable) <= 0) {
checkFailureAndPropagate(writerThread, null, proc,
stderrBuffer)
+ completed = true
Review comment:
Alternatively, I could just set `scriptOutputWritable` to `null` here,
and I wouldn't need the if statement at the top. That seemed to work. However,
it feels a little unhygienic to read from an inputStream that has already
returned EOF, so I added the flag.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]