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 3452C200B6F for ; Wed, 10 Aug 2016 01:36:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 32E2D160AAD; Tue, 9 Aug 2016 23:36:22 +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 7BC9A160AA5 for ; Wed, 10 Aug 2016 01:36:21 +0200 (CEST) Received: (qmail 86621 invoked by uid 500); 9 Aug 2016 23:36:20 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 86610 invoked by uid 99); 9 Aug 2016 23:36:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2016 23:36:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6FF072C0003 for ; Tue, 9 Aug 2016 23:36:20 +0000 (UTC) Date: Tue, 9 Aug 2016 23:36:20 +0000 (UTC) From: "Shivaram Venkataraman (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-16883) SQL decimal type is not properly cast to number when collecting SparkDataFrame MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 09 Aug 2016 23:36:22 -0000 [ https://issues.apache.org/jira/browse/SPARK-16883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414446#comment-15414446 ] Shivaram Venkataraman commented on SPARK-16883: ----------------------------------------------- Yeah I see that - The change I am proposing is to add another case inside writeObject to convert DecimalTypes to doubles using something like the function in https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L344 I guess the question is whether this change is more intrusive than the other one and how will this impact handling more types in the future. It'll be great if you can try out one or both of them and open a PR for more discussion. > SQL decimal type is not properly cast to number when collecting SparkDataFrame > ------------------------------------------------------------------------------ > > Key: SPARK-16883 > URL: https://issues.apache.org/jira/browse/SPARK-16883 > Project: Spark > Issue Type: Bug > Components: SparkR > Affects Versions: 2.0.0 > Reporter: Hossein Falaki > > To reproduce run following code. As you can see "y" is a list of values. > {code} > registerTempTable(createDataFrame(iris), "iris") > str(collect(sql("select cast('1' as double) as x, cast('2' as decimal) as y from iris limit 5"))) > 'data.frame': 5 obs. of 2 variables: > $ x: num 1 1 1 1 1 > $ y:List of 5 > ..$ : num 2 > ..$ : num 2 > ..$ : num 2 > ..$ : num 2 > ..$ : num 2 > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org