sigmod commented on code in PR #55629:
URL: https://github.com/apache/spark/pull/55629#discussion_r3184186369
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -2362,39 +2362,68 @@ class AstBuilder extends DataTypeAstBuilder
}
}
- // Resolve the join type and join condition
- val (joinType, condition) = Option(ctx.joinCriteria) match {
- case Some(c) if c.USING != null =>
- if (ctx.LATERAL != null) {
- throw
QueryParsingErrors.lateralJoinWithUsingJoinUnsupportedError(ctx)
+ if (ctx.nearestByClause != null) {
+ if (ctx.LATERAL != null) {
+ throw
QueryParsingErrors.nearestByJoinWithLateralUnsupportedError(ctx)
+ }
+ if (!Seq(Inner, LeftOuter).contains(baseJoinType)) {
+ throw QueryParsingErrors.unsupportedNearestByJoinTypeError(
+ ctx, baseJoinType.sql, NearestByJoinType.supportedDisplay)
+ }
+ val clause = ctx.nearestByClause
+ val approx = clause.APPROX != null
+ val numResults = Option(clause.num).map { n =>
+ // Guard against literals that overflow Long.
Review Comment:
Can it just be an expression, similary to `MaxMinByK`'s `kExpr` and
`limitExpr` in `GlobalLimit`/`LocalLimit`?
--
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]