From 9f29766511aed5728707c5cfc3d46176826d4148 Mon Sep 17 00:00:00 2001 From: gengjiaan Date: Thu, 26 Nov 2020 15:08:51 +0800 Subject: [PATCH] Fix issue --- .../org/apache/spark/sql/catalyst/parser/AstBuilder.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala index 04f6542cb0ed3..1cf2939b62fca 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala @@ -819,8 +819,10 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with SQLConfHelper with Logg wCtx => (wCtx.name.getText, typedVisit[WindowSpec](wCtx.windowSpec)) } - baseWindowTuples.groupBy(_._1).foreach { case (k, v) if v.size > 1 => - throw new ParseException(s"The definition of window '$k' is repetitive", ctx) + baseWindowTuples.groupBy(_._1).foreach { kv => + if (kv._2.size > 1) { + throw new ParseException(s"The definition of window '${kv._1}' is repetitive", ctx) + } } val baseWindowMap = baseWindowTuples.toMap