-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-4131] [SQL] Support INSERT OVERWRITE [LOCAL] DIRECTORY '/path/to/dir' [ROW FORMAT row_format] [STORED AS file_format] query. #13067
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
Conversation
r(0) = r(0) + a.name + "," | ||
r(1) = r(1) + a.dataType.typeName + ":" | ||
r | ||
}) |
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.
Maybe it would be nicer if the additional closure is removed. This was discussed in (http://apache-spark-developers-list.1001551.n3.nabble.com/Question-about-Scala-style-explicit-typing-within-transformation-functions-and-anonymous-val-td17173.html)
val (cols, types) = child.output.foldLeft(("", "")) { case (r, a) =>
r(0) = r(0) + a.name + ","
r(1) = r(1) + a.dataType.typeName + ":"
r
}
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.
Fixed.
( it seems the last part of the title os truncated.) |
@HyukjinKwon I don't understand your last comment
|
@Parth-Brahmbhatt I think the title of this PR, |
@HyukjinKwon fixed. |
Any update on this? Seems like a useful feature. |
Please let me cc @hvanhovell because it seems the most of codes were recently updated by him. |
@hvanhovell @rxin can one of you review this PR. I was hoping to get it in the 2.0 branch if its not too late. |
@@ -713,6 +714,7 @@ WITH: 'WITH'; | |||
VALUES: 'VALUES'; | |||
CREATE: 'CREATE'; | |||
TABLE: 'TABLE'; | |||
DIRECTORY: 'DIRECTORY'; |
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.
Add this keyword to the nonReserved
rule.
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.
Added.
…to/dir' [ROW FORMAT row_format] [STORED AS file_format] query.
326c27f
to
056eac6
Compare
Is this feature available yet? |
This sounds a syntactic sugar. Users can achieve it by creating an external table and then inserting the data. Another way is to use our DataFrameWriter API. Please let me know whether we should still continue this PR? |
Can one of the admins verify this patch? |
Since this PR #18975 will be merged soon. Could you close this? Thanks! |
What changes were proposed in this pull request?
Support INSERT OVERWRITE [LOCAL] DIRECTORY '/path/to/dir' [ROW FORMAT row_format] [STORED AS file_format] query
How was this patch tested?
I have tested the patch locally and I have some unit tests that I am finishing up.