You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2016/05/24 08:43:13 UTC
[jira] [Closed] (SPARK-15476) Support for reading text data source
without specifying schema
[ https://issues.apache.org/jira/browse/SPARK-15476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon closed SPARK-15476.
--------------------------------
Resolution: Not A Problem
I was totally stupid. I was testing {{test}} for {{text}}. Closing this. Sorry for the noise..
> Support for reading text data source without specifying schema
> --------------------------------------------------------------
>
> Key: SPARK-15476
> URL: https://issues.apache.org/jira/browse/SPARK-15476
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Hyukjin Kwon
> Priority: Minor
>
> Currently, Text data source requires a schema.
> So the codes below:
> {code}
> emptyDf.write
> .format("text")
> .save(path.getCanonicalPath)
> val copyEmptyDf = spark.read
> .format("text")
> .load(path.getCanonicalPath)
> {code}
> throws an exception below:
> {code}
> key not found: dataSchema
> java.util.NoSuchElementException: key not found: dataSchema
> at scala.collection.MapLike$class.default(MapLike.scala:228)
> at org.apache.spark.sql.execution.datasources.CaseInsensitiveMap.default(ddl.scala:139)
> at scala.collection.MapLike$class.apply(MapLike.scala:141)
> at org.apache.spark.sql.execution.datasources.CaseInsensitiveMap.apply(ddl.scala:139)
> at org.apache.spark.sql.sources.SimpleTextSource.inferSchema(SimpleTextRelation.scala:43)
> at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:347)
> at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:347)
> at scala.Option.orElse(Option.scala:289)
> {code}
> It might be nicer if this option is not required. CSV is doing this for CSV data which do not have header or empty string for fields in header.
--
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