Github user andrewor14 commented on a diff in the pull request: https://github.com/apache/spark/pull/8953#discussion_r41455801 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/local/HashJoinNodeSuite.scala --- @@ -34,6 +36,40 @@ class HashJoinNodeSuite extends LocalNodeTest { } /** + * Builds a [[HashedRelation]] based on a resolved `buildKeys` + * and a resolved `buildNode`. + */ + private def buildHashedRelation( + conf: SQLConf, + buildKeys: Seq[Expression], + buildNode: LocalNode): HashedRelation = { + + // Check if we are in the Unsafe mode. + val isUnsafeMode = + conf.codegenEnabled && + conf.unsafeEnabled && + UnsafeProjection.canSupport(buildKeys) + + // Create projection used for extracting keys + val buildSideKeyGenerator = + if (isUnsafeMode) { + UnsafeProjection.create(buildKeys, buildNode.output) + } else { + buildNode.newMutableProjection(buildKeys, buildNode.output)() + } + + // Setup the node. + buildNode.prepare() + buildNode.open() + // Build the HashedRelation + val hashedRelation = HashedRelation(buildNode, buildSideKeyGenerator) + // Close the node. --- End diff -- can you remove some of these comments that don't add any value?
--- 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