Github user jiangxb1987 commented on a diff in the pull request:
https://github.com/apache/spark/pull/18540#discussion_r130076316
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
---
@@ -1179,32 +1179,26 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
}
/**
- * Create or resolve a [[FrameBoundary]]. Simple math expressions are
allowed for Value
- * Preceding/Following boundaries. These expressions must be constant
(foldable) and return an
- * integer value.
+ * Create or resolve a frame boundary expressions.
*/
- override def visitFrameBound(ctx: FrameBoundContext): FrameBoundary =
withOrigin(ctx) {
- // We currently only allow foldable integers.
- def value: Int = {
+ override def visitFrameBound(ctx: FrameBoundContext): Expression =
withOrigin(ctx) {
+ def value: Expression = {
val e = expression(ctx.expression)
- validate(e.resolved && e.foldable && e.dataType == IntegerType,
- "Frame bound value must be a constant integer.",
- ctx)
- e.eval().asInstanceOf[Int]
+ validate(e.resolved && e.foldable, "Frame bound value must be a
literal.", ctx)
--- End diff --
How about keep this so we can fail earlier?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]