From reviews-return-966142-archive-asf-public=cust-asf.ponee.io@spark.apache.org Thu Nov 14 02:33:25 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 26783180621 for ; Thu, 14 Nov 2019 03:33:25 +0100 (CET) Received: (qmail 54138 invoked by uid 500); 14 Nov 2019 02:33:24 -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 54126 invoked by uid 99); 14 Nov 2019 02:33:24 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2019 02:33:24 +0000 From: GitBox To: reviews@spark.apache.org Subject: [GitHub] [spark] turboFei commented on a change in pull request #26485: [SPARK-29860][SQL] Fix dataType mismatch issue for InSubquery. Message-ID: <157369880426.4165.11042501599902852980.gitbox@gitbox.apache.org> Date: Thu, 14 Nov 2019 02:33:24 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit turboFei commented on a change in pull request #26485: [SPARK-29860][SQL] Fix dataType mismatch issue for InSubquery. URL: https://github.com/apache/spark/pull/26485#discussion_r346101593 ########## File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala ########## @@ -3304,6 +3304,26 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession { """.stripMargin).collect() } } + + test("SPARK-29860: Fix dataType mismatch issue for InSubquery") { + withTempView("ta", "tb", "tc", "td") { + sql("create temporary view ta as select * from values(cast(1 as Decimal(8, 0))) as ta(id)") + sql("create temporary view tb as select * from values(cast(1 as Decimal(9, 0))) as tb(id)") + sql("create temporary view tc as select * from values(cast(1 as Decimal(7, 2))), " + + "cast(1.23 as Decimal(7,2)) as tc(id)") + sql("create temporary view td as select * from values(cast(1 as Decimal(38, 31))) as td(id)") + val df1 = sql("select id from ta where id in (select id from tb)") + checkAnswer(df1, Array(Row(new java.math.BigDecimal(1)))) Review comment: > I think the PR description above should be self-descriptive, so could you please make that more clearer? What's a root cause of this issue, how to fix, brabrabra... Thanks, updated. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org