From issues-return-191360-archive-asf-public=cust-asf.ponee.io@spark.apache.org Thu May 10 18:27:06 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 757D118063A for ; Thu, 10 May 2018 18:27:06 +0200 (CEST) Received: (qmail 24303 invoked by uid 500); 10 May 2018 16:27:05 -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 24288 invoked by uid 99); 10 May 2018 16:27:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2018 16:27:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id F2BD71808E7 for ; Thu, 10 May 2018 16:27:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dc4Dq28Bp6Wr for ; Thu, 10 May 2018 16:27:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 10A925FDE4 for ; Thu, 10 May 2018 16:27:02 +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 58896E0F7F for ; Thu, 10 May 2018 16:27:01 +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 A737721556 for ; Thu, 10 May 2018 16:27:00 +0000 (UTC) Date: Thu, 10 May 2018 16:27:00 +0000 (UTC) From: "Dongjoon Hyun (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-24204) Verify a write schema in Json/Orc/ParquetFileFormat 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-24204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dongjoon Hyun updated SPARK-24204: ---------------------------------- Summary: Verify a write schema in Json/Orc/ParquetFileFormat (was: Verify a write schema in Orc/ParquetFileFormat) > Verify a write schema in Json/Orc/ParquetFileFormat > --------------------------------------------------- > > Key: SPARK-24204 > URL: https://issues.apache.org/jira/browse/SPARK-24204 > Project: Spark > Issue Type: Improvement > Components: SQL > Affects Versions: 2.3.0 > Reporter: Takeshi Yamamuro > Priority: Minor > > The native orc file format throws an exception with a meaningless message in executor-sides when unsupported types passed; > {code} > scala> val rdd = spark.sparkContext.parallelize(List(Row(1, null), Row(2, null))) > scala> val schema = StructType(StructField("a", IntegerType) :: StructField("b", NullType) :: Nil) > scala> val df = spark.createDataFrame(rdd, schema) > scala> df.write.orc("/tmp/orc") > java.lang.IllegalArgumentException: Can't parse category at 'struct' > at org.apache.orc.TypeDescription.parseCategory(TypeDescription.java:223) > at org.apache.orc.TypeDescription.parseType(TypeDescription.java:332) > at org.apache.orc.TypeDescription.parseStruct(TypeDescription.java:327) > at org.apache.orc.TypeDescription.parseType(TypeDescription.java:385) > at org.apache.orc.TypeDescription.fromString(TypeDescription.java:406) > at org.apache.spark.sql.execution.datasources.orc.OrcSerializer.org$apache$spark$sql$execution$datasources$orc$OrcSerializer$$createOrcValue(OrcSerializ > er.scala:226) > at org.apache.spark.sql.execution.datasources.orc.OrcSerializer.(OrcSerializer.scala:36) > at org.apache.spark.sql.execution.datasources.orc.OrcOutputWriter.(OrcOutputWriter.scala:36) > at org.apache.spark.sql.execution.datasources.orc.OrcFileFormat$$anon$1.newInstance(OrcFileFormat.scala:108) > at org.apache.spark.sql.execution.datasources.FileFormatWriter$SingleDirectoryWriteTask.newOutputWriter(FileFormatWriter.scala:376) > at org.apache.spark.sql.execution.datasources.FileFormatWriter$SingleDirectoryWriteTask.execute(FileFormatWriter.scala:387) > at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$org$apache$spark$sql$execution$datasources$FileFormatWriter$$executeTask$3.apply > (FileFormatWriter.scala:278) > {code} > It seems to be better to verify a write schema in a driver side for users along with the CSV fromat; > https://github.com/apache/spark/blob/76ecd095024a658bf68e5db658e4416565b30c17/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala#L65 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org