Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 46FA3200D24 for ; Tue, 24 Oct 2017 14:30:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 458C1160BE0; Tue, 24 Oct 2017 12:30:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B20DF160BDB for ; Tue, 24 Oct 2017 14:30:40 +0200 (CEST) Received: (qmail 59667 invoked by uid 500); 24 Oct 2017 12:30:40 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 59655 invoked by uid 99); 24 Oct 2017 12:30:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2017 12:30:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 95F01DFA3C; Tue, 24 Oct 2017 12:30:39 +0000 (UTC) From: wzhfy To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #17100: [SPARK-13947][SQL] The error message from using a... Content-Type: text/plain Message-Id: <20171024123039.95F01DFA3C@git1-us-west.apache.org> Date: Tue, 24 Oct 2017 12:30:39 +0000 (UTC) archived-at: Tue, 24 Oct 2017 12:30:41 -0000 Github user wzhfy commented on a diff in the pull request: https://github.com/apache/spark/pull/17100#discussion_r146543299 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala --- @@ -270,12 +270,25 @@ trait CheckAnalysis extends PredicateHelper { operator match { case o if o.children.nonEmpty && o.missingInput.nonEmpty => + val resolver = plan.conf.resolver + val attrsWithSameName = o.missingInput.filter { missing => + o.inputSet.exists(input => resolver(missing.name, input.name)) + } + val repeatedNameHint = if (attrsWithSameName.nonEmpty) { + val sameNames = attrsWithSameName.map(_.name).mkString(",") + s"""Attribute(s) with the same name appear in the operation: `$sameNames`. + |Please check if the right attribute(s) are used.""".stripMargin --- End diff -- Personally I prefer one line message because it's an parameter of `AnalysisException`, but that's not a strong point. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org