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 D59EB200C46 for ; Wed, 15 Mar 2017 01:04:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D42F5160B89; Wed, 15 Mar 2017 00:04:47 +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 288F6160B7E for ; Wed, 15 Mar 2017 01:04:47 +0100 (CET) Received: (qmail 58734 invoked by uid 500); 15 Mar 2017 00:04:46 -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 58725 invoked by uid 99); 15 Mar 2017 00:04:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2017 00:04:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id EEE50C1275 for ; Wed, 15 Mar 2017 00:04:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.452 X-Spam-Level: * X-Spam-Status: No, score=1.452 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gru65RdH1UQt for ; Wed, 15 Mar 2017 00:04:45 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0C3205FAD8 for ; Wed, 15 Mar 2017 00:04:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E07ECE05F2 for ; Wed, 15 Mar 2017 00:04:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 9C63D243A8 for ; Wed, 15 Mar 2017 00:04:41 +0000 (UTC) Date: Wed, 15 Mar 2017 00:04:41 +0000 (UTC) From: "Hyukjin Kwon (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-19950) nullable ignored when df.load() is executed for file-based data source MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 15 Mar 2017 00:04:48 -0000 [ https://issues.apache.org/jira/browse/SPARK-19950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925301#comment-15925301 ] Hyukjin Kwon commented on SPARK-19950: -------------------------------------- [~kiszk], do you think we maybe resolve this JIRA as a duplicate of SPARK-16472 if this describes file format datasources force the schema into nullable ones? > nullable ignored when df.load() is executed for file-based data source > ---------------------------------------------------------------------- > > Key: SPARK-19950 > URL: https://issues.apache.org/jira/browse/SPARK-19950 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.2.0 > Reporter: Kazuaki Ishizaki > > This problem is reported in [Databricks forum|https://forums.databricks.com/questions/7123/nullable-seemingly-ignored-when-reading-parquet.html]. > When we execute the following code, a schema for "id" in {{dfRead}} has {{nullable = true}}. It should be {{nullable = false}}. > {code:java} > val field = "id" > val df = spark.range(0, 5, 1, 1).toDF(field) > val fmt = "parquet" > val path = "/tmp/parquet" > val schema = StructType(Seq(StructField(field, LongType, false))) > df.write.format(fmt).mode("overwrite").save(path) > val dfRead = spark.read.format(fmt).schema(schema).load(path) > dfRead.printSchema > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org