{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13254","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13254/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13254/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13254/events","html_url":"https://github.com/apache/spark/pull/13254","id":156151630,"number":13254,"title":"[WIP][SPARK-15475][SQL] Support for reading text data source without specifying schema","user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars.githubusercontent.com/u/6477701?v=3","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-22T13:13:59Z","updated_at":"2016-05-22T15:05:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13254","html_url":"https://github.com/apache/spark/pull/13254","diff_url":"https://github.com/apache/spark/pull/13254.diff","patch_url":"https://github.com/apache/spark/pull/13254.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently, Text data source requires a schema.\r\n\r\nSo the codes below:\r\n\r\n```scala\r\nemptyDf.write\r\n  .format(\"text\")\r\n  .save(path.getCanonicalPath)\r\n\r\nval copyEmptyDf = spark.read\r\n  .format(\"text\")\r\n  .load(path.getCanonicalPath)\r\n\r\ncopyEmptyDf.show()\r\n```\r\n\r\nthrows an exception below:\r\n\r\n```scala\r\nkey not found: dataSchema\r\njava.util.NoSuchElementException: key not found: dataSchema\r\n\tat scala.collection.MapLike$class.default(MapLike.scala:228)\r\n\tat org.apache.spark.sql.execution.datasources.CaseInsensitiveMap.default(ddl.scala:139)\r\n\tat scala.collection.MapLike$class.apply(MapLike.scala:141)\r\n\tat org.apache.spark.sql.execution.datasources.CaseInsensitiveMap.apply(ddl.scala:139)\r\n\tat org.apache.spark.sql.sources.SimpleTextSource.inferSchema(SimpleTextRelation.scala:43)\r\n\tat org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:347)\r\n\tat org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:347)\r\n\tat scala.Option.orElse(Option.scala:289)\r\n```\r\n\r\nThis PR adds the support for a default schema with unnamed columns just like CSV data sources.\r\n\r\n## How was this patch tested?\r\n\r\nUnit test in `SimpleTextHadoopFsRelationSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/220837154","html_url":"https://github.com/apache/spark/pull/13254#issuecomment-220837154","issue_url":"https://api.github.com/repos/apache/spark/issues/13254","id":220837154,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T15:05:33Z","updated_at":"2016-05-22T15:05:33Z","body":"**[Test build #59106 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59106/consoleFull)** for PR 13254 at commit [`0c58c4f`](https://github.com/apache/spark/commit/0c58c4ff9adf7bff61c3f07e39ec780b1599da55).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}