LukaZdravic commented on code in PR #60227:
URL: https://github.com/apache/spark/pull/60227#discussion_r4514613735
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/UnionCodegenSuite.scala:
##########
@@ -533,6 +534,89 @@ class UnionCodegenSuite extends SharedSparkSession with
AdaptiveSparkPlanHelper
}
}
+ /** A union of an ASOF join in `direction` and a range. */
+ private def asOfJoinUnion(direction: String): DataFrame = {
+ // `joinAsOf` is on the classic Dataset, so build the inputs from
`spark.range`.
+ val left = spark.range(10).select(col("id").as("k"), (col("id") *
2).as("ts"))
+ val right = spark.range(10).select(col("id").as("k"), (col("id") * 2 -
1).as("ts"))
+ left.joinAsOf(right, left("ts"), right("ts"), usingColumns = Seq("k"),
+ joinType = "inner", tolerance = null, allowExactMatches = true,
direction = direction)
+ .select(left("k"), right("ts"))
+ .union(rangeDF(100, 103).select(col("id").as("k"), col("id").as("ts")))
+ }
+
+ /** The rows of `asOfJoinUnion` in any direction: each key has one right
row, just before. */
Review Comment:
Applied the suggestion, thanks!
--
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]