srielau opened a new pull request, #57380:
URL: https://github.com/apache/spark/pull/57380
### What changes were proposed in this pull request?
Product fixes uncovered while landing ASOF JOIN golden-file tests
(SPARK-58173):
1. **Non-boolean `ON`** — report `JOIN_CONDITION_IS_NOT_BOOLEAN_TYPE`
(`CheckAnalysis`)
2. **Invalid `MATCH_CONDITION` operator errors** — recover SQL operator text
(`!=` vs `<>`, `IS [NOT] DISTINCT FROM`) via parse-tree inspection instead of
Catalyst pretty names (`AstBuilder`)
3. **Foldable `MATCH_CONDITION` operands** — assign literals,
`CURRENT_TIMESTAMP()`, and session variables to join sides by syntactic
position (`AsOfJoin.normalizeMatchOperands`)
4. **Subquery resolution** — resolve subqueries in `AsOfJoin` `ON` /
`MATCH_CONDITION` like regular `Join` (`Analyzer.ResolveSubquery`,
`ValidateSubqueryExpression`)
5. **Struct/array `MATCH_CONDITION` analysis** — reject empty structs;
require identical array element types so analysis matches order-expression
construction (`ResolveAsOfJoin`)
### Why are the changes needed?
Without these fixes, FVT and integration tests surfaced misleading errors
(e.g. `TABLE_OR_VIEW_NOT_FOUND` for unresolved subqueries) or
analysis/execution mismatches on array operands.
### Does this PR introduce _any_ user-facing change?
Yes — clearer analysis errors and correct behavior for foldable operands and
subqueries in ASOF JOIN.
### How was this patch tested?
- `PlanParserSuite` — invalid `MATCH_CONDITION` operator text
- `AsOfJoinSQLSuite` — foldable operands, subqueries, struct/array operands
```bash
build/sbt -Dscalastyle.skip=true \
"sql/testOnly org.apache.spark.sql.catalyst.parser.PlanParserSuite -- -z
asof" \
"sql/testOnly org.apache.spark.sql.AsOfJoinSQLSuite"
```
Stacked PR: [SPARK-58173](https://github.com/apache/spark/pull/57306) (FVT
goldens) builds on this branch.
### Was this patch authored or co-authored using generative AI tooling?
No.
--
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]