Return-Path: X-Original-To: apmail-spark-issues-archive@minotaur.apache.org Delivered-To: apmail-spark-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 57C58187CA for ; Sun, 20 Sep 2015 19:13:04 +0000 (UTC) Received: (qmail 64709 invoked by uid 500); 20 Sep 2015 19:13:04 -0000 Delivered-To: apmail-spark-issues-archive@spark.apache.org Received: (qmail 64668 invoked by uid 500); 20 Sep 2015 19:13:04 -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 64657 invoked by uid 99); 20 Sep 2015 19:13:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Sep 2015 19:13:04 +0000 Date: Sun, 20 Sep 2015 19:13:04 +0000 (UTC) From: "Reynold Xin (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-10588) Saving a DataFrame containing only nulls to JSON doesn't work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SPARK-10588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Reynold Xin updated SPARK-10588: -------------------------------- Target Version/s: 1.6.0 (was: 1.6.0, 1.5.1) > Saving a DataFrame containing only nulls to JSON doesn't work > ------------------------------------------------------------- > > Key: SPARK-10588 > URL: https://issues.apache.org/jira/browse/SPARK-10588 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 1.5.0 > Reporter: Cheng Lian > Priority: Minor > > Snippets to reproduce this issue: > {noformat} > val path = "file:///tmp/spark/null" > // A single row containing a single null double, saving to JSON, wrong > sqlContext. > range(1).selectExpr("CAST(NULL AS DOUBLE) AS c0"). > write.mode("overwrite").json(path) > sqlContext.read.json(path).show() > ++ > || > ++ > || > ++ > // Two rows each containing a single null double, saving to JSON, wrong > sqlContext. > range(2).selectExpr("CAST(NULL AS DOUBLE) AS c0"). > write.mode("overwrite").json(path) > sqlContext.read.json(path).show() > ++ > || > ++ > || > || > ++ > // A single row containing two null doubles, saving to JSON, wrong > sqlContext. > range(1).selectExpr("CAST(NULL AS DOUBLE) AS c0", "CAST(NULL AS DOUBLE) AS c1"). > write.mode("overwrite").json(path) > sqlContext.read.json(path).show() > ++ > || > ++ > || > ++ > // A single row containing a single null double, saving to Parquet, OK > sqlContext. > range(1).selectExpr("CAST(NULL AS DOUBLE) AS c0"). > write.mode("overwrite").parquet(path) > sqlContext.read.parquet(path).show() > +----+ > | d| > +----+ > |null| > +----+ > // Two rows, one containing a single null double, one containing non-null double, saving to JSON, OK > sqlContext. > range(2).selectExpr("IF(id % 2 = 0, CAST(NULL AS DOUBLE), id) AS c0"). > write.mode("overwrite").json(path) > sqlContext.read.json(path).show() > +----+ > | d| > +----+ > |null| > | 1.0| > +----+ > {noformat} -- 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