-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-12562][SQL] DataFrame.write.format(text) requires the column name to be called value #10515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,8 @@ class TextSuite extends QueryTest with SharedSQLContext { | |
| verifyFrame(sqlContext.read.text(testFile)) | ||
| } | ||
|
|
||
| test("writing") { | ||
| val df = sqlContext.read.text(testFile) | ||
| test("SPARK-12562 verify write.text() can handle column name beyond `value`") { | ||
| val df = sqlContext.read.text(testFile).withColumnRenamed("value", "adwrasdf") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be failed because the later method
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. it is right. |
||
|
|
||
| val tempFile = Utils.createTempDir() | ||
| tempFile.delete() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make sure that
textSchemais a struct type that has only one string field?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cloud-fan DefaultSource.scala is the only place that creates a TextRelation, and it verifies that the schema is size 1 and of type string before creating a TextRelation. So I think it is fine not to verify again here. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, then it's fine