Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8953#discussion_r41439778
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/local/HashJoinNodeSuite.scala
 ---
    @@ -51,20 +87,50 @@ class HashJoinNodeSuite extends LocalNodeTest {
           val rightInputMap = rightInput.toMap
           val leftNode = new DummyNode(joinNameAttributes, leftInput)
           val rightNode = new DummyNode(joinNicknameAttributes, rightInput)
    -      val makeNode = (node1: LocalNode, node2: LocalNode) => {
    -        resolveExpressions(new HashJoinNode(
    -          conf, Seq('id1), Seq('id2), buildSide, node1, node2))
    +      val makeBinaryHashJoinNode = (node1: LocalNode, node2: LocalNode) => 
{
    +        val binaryHashJoinNode =
    +          BinaryHashJoinNode(conf, Seq('id1), Seq('id2), buildSide, node1, 
node2)
    +        resolveExpressions(binaryHashJoinNode)
    +      }
    +      val makeBroadcastJoinNode = (node1: LocalNode, node2: LocalNode) => {
    +        val leftKeys = Seq('id1.attr)
    +        val rightKeys = Seq('id2.attr)
    +        // Figure out the build side and stream side.
    +        val (buildNode, buildKeys, streamedNode, streamedKeys) = buildSide 
match {
    +          case BuildLeft => (node1, leftKeys, node2, rightKeys)
    +          case BuildRight => (node2, rightKeys, node1, leftKeys)
    +        }
    +        // Resolve the expressions of the build side and then create a 
HashedRelation.
    +        val resolvedBuildNode = resolveExpressions(buildNode)
    +        val resolvedBuildKeys = resolveExpressions(buildKeys, 
resolvedBuildNode)
    +        val hashedRelation = buildHashedRelation(conf, resolvedBuildKeys, 
resolvedBuildNode)
    +        val broadcastHashedRelation = 
sqlContext.sparkContext.broadcast(hashedRelation)
    --- End diff --
    
    @andrewor14 This is the place I need sqlcontext.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to