[SPARK-9990][SQL]Create local hash join operator#8535
Conversation
There was a problem hiding this comment.
Need to use a new method name because the default parameter is in conflict with overloading.
There was a problem hiding this comment.
can you add some java doc to explain what this method's doing?
|
Test build #41824 has finished for PR 8535 at commit
|
|
@rxin do we need to make these local classes |
There was a problem hiding this comment.
shall we just use tungstenEnabled here?
There was a problem hiding this comment.
and the ProjectNode always uses unsafe projection, should we control that by this config?
There was a problem hiding this comment.
and the ProjectNode always uses unsafe projection, should we control that by this config?
Agreed.
There was a problem hiding this comment.
shall we just use tungstenEnabled here?
Just followed SparkPlan.
|
Test build #41902 has finished for PR 8535 at commit
|
There was a problem hiding this comment.
I actually think implementing the wrapper is better since it's not very complicated. Duplicate code in general is really bad and hard to maintain. We can have something like the following in LocalNode
def asIterator: Iterator[InternalRow] = new LocalNodeIterator(this)
then provide the dummy SQLMetrics.nullLongMetric
There was a problem hiding this comment.
I wrote some code for this. Feel free to steal or come up with something better. (not tested!)
/**
* An thin wrapper around a [[LocalNode]] that provides an iterator interface.
*/
private class LocalNodeIterator(localNode: LocalNode) extends Iterator[InternalRow] {
private var nextRow: InternalRow = _
override def hasNext: Boolean = {
if (nextRow == null) {
val res = localNode.next()
if (res) {
nextRow = localNode.fetch()
}
res
} else {
true
}
}
override def next(): InternalRow = {
if (hasNext) {
val res = nextRow
nextRow = null
res
} else {
throw new NoSuchElementException
}
}
}
There was a problem hiding this comment.
Thanks. Added LocalNodeIterator to this PR :)
This PR includes the following changes: