HyukjinKwon commented on a change in pull request #23746: [SPARK-26761][SQL][R]
Vectorized R gapply() implementation
URL: https://github.com/apache/spark/pull/23746#discussion_r255298042
##########
File path: core/src/main/scala/org/apache/spark/api/r/RRunner.scala
##########
@@ -91,28 +91,70 @@ private[spark] class RRunner[U](
}
try {
- return new Iterator[U] {
- def next(): U = {
- val obj = _nextObj
- if (hasNext) {
- _nextObj = read()
- }
- obj
+ newReaderIterator(dataStream, errThread)
+ } catch {
+ case e: Exception =>
+ throw new SparkException("R computation failed with\n " +
errThread.getLines(), e)
+ }
+ }
+
+ protected def newReaderIterator(
Review comment:
Codes here are almost not changed. I just exposed some method to inherit it
in ArrowRRunner. This code needs refactoring as a common parent like
PythonRunner but I don't target it here.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]