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

    https://github.com/apache/spark/pull/20133#discussion_r159156756
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala
 ---
    @@ -39,6 +41,17 @@ object ParserUtils {
         throw new ParseException(s"Operation not allowed: $message", ctx)
       }
     
    +  def duplicateClausesNotAllowed(message: String, ctx: ParserRuleContext): 
Nothing = {
    +    throw new ParseException(s"Found duplicate clauses: $message", ctx)
    --- End diff --
    
    We cannot merge these two functions to check the duplication?
    e.g.,
    ```
      def checkDuplicateClauses[T](nodes: util.List[T], clauseName: String, 
ctx: ParserRuleContext): Unit = {
        if (nodes.size() > 1) {
          throw new ParseException(s"Found duplicate clauses: $clauseName", ctx)
        }
      }
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to