Github user ericl commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14656#discussion_r74859905
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ---
    @@ -653,6 +653,19 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] 
with Logging {
       }
     
       /**
    +   * Create a table-valued function call with arguments, e.g. range(1000)
    +   */
    +  override def visitTableValuedFunction(ctx: TableValuedFunctionContext)
    +      : LogicalPlan = withOrigin(ctx) {
    +    val expressions = ctx.expression.asScala.map { ec =>
    +      val e = expression(ec)
    +      assert(e.foldable, "All arguments of a table-valued-function must be 
constants.", ec)
    --- End diff --
    
    Do you mean defer evaluation of the arguments until after analysis? 
Otherwise, it would presumably crash during resolution when `eval` is called if 
this check was moved.


---
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]

Reply via email to