This is an automated email from the ASF dual-hosted git repository.
uros-b pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.x by this push:
new 83b3eba135d7 [MINOR][SQL] State the NULL STRUCT rule in the
AsOfJoin.buildMatchExpressions Scaladoc
83b3eba135d7 is described below
commit 83b3eba135d76e6039b0efc555bcef80ce731999
Author: Luka Zdravić <[email protected]>
AuthorDate: Thu Oct 8 09:59:04 2026 +0000
[MINOR][SQL] State the NULL STRUCT rule in the
AsOfJoin.buildMatchExpressions Scaladoc
### What changes were proposed in this pull request?
Move the inline comment in `AsOfJoin.buildMatchExpressions` into a Scaladoc
and state it as the method's rule: the operands are compared as whole values,
so a NULL struct never matches, while a struct whose fields are all NULL can.
The Scaladoc also names the two returned expressions, `asOfCondition` and
`orderExpression`.
### Why are the changes needed?
Follow-up to SPARK-59858 (#59134). The old comment ("Compare the operands
as they are") only made sense next to the struct-rebuilding code that
SPARK-59858 removed. The NULL STRUCT rule is the part a reader needs, so the
Scaladoc keeps that.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Comment-only change.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
Closes #59278 from LukaZdravic/minor-asof-null-struct-scaladoc.
Authored-by: Luka Zdravić <[email protected]>
Signed-off-by: Uros Bojanic <[email protected]>
(cherry picked from commit f3c2cc2deb5bd17c7d031aa9d0f880bf9bea0f4e)
Signed-off-by: Uros Bojanic <[email protected]>
---
.../spark/sql/catalyst/plans/logical/basicLogicalOperators.scala | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
index 5b5139780131..d414c2966ab5 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
@@ -2923,13 +2923,16 @@ object AsOfJoin {
}
}
+ /**
+ * Returns the `asOfCondition` and `orderExpression` for one MATCH_CONDITION
comparison. The
+ * operands are compared as whole values, so a NULL struct never matches,
while a struct whose
+ * fields are all NULL can.
+ */
private def buildMatchExpressions(
leftOperand: Expression,
rightOperand: Expression,
operator: MatchComparisonOperator): (Expression, Expression) = {
val orderExpression = buildOrderExpression(leftOperand, rightOperand,
operator)
- // Compare the operands as they are: a comparison already matches struct
fields by position,
- // and a NULL struct stays NULL, so it never matches.
operator match {
case GreaterThanOrEqualOp =>
(GreaterThanOrEqual(leftOperand, rightOperand), orderExpression)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]