This is an automated email from the ASF dual-hosted git repository.
uros-b pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f3c2cc2deb5b [MINOR][SQL] State the NULL STRUCT rule in the
AsOfJoin.buildMatchExpressions Scaladoc
f3c2cc2deb5b is described below
commit f3c2cc2deb5bd17c7d031aa9d0f880bf9bea0f4e
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]>
---
.../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 326cc5925d8b..e342615b740d 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
@@ -2922,13 +2922,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]