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

    https://github.com/apache/spark/pull/14034#discussion_r69599041
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
 ---
    @@ -46,6 +46,20 @@ trait CheckAnalysis extends PredicateHelper {
         }).length > 1
       }
     
    +  private def checkLimitClause(limitExpr: Expression): Unit = {
    +    if (!limitExpr.foldable) {
    --- End diff --
    
    Are you saying we should change the SQL parser? You know, if so, we also 
need to change the `TABLESAMPLE n ROWS`.
    
    FYI, even Hive does not support foldable expressions.
    ```
    hive> select * from t1 limit 1 + 1;
    FAILED: ParseException line 1:25 missing EOF at '+' near '1'
    hive> select * from t1 limit (1+1);
    FAILED: ParseException line 1:23 extraneous input '(' expecting Number near 
'1'
    ```
    I found that Impala supports it. 
    
http://www.cloudera.com/documentation/archive/impala/2-x/2-1-x/topics/impala_limit.html


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to