Skip to content

[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

Closed

Conversation

Parth-Brahmbhatt
Copy link
Contributor

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.

@Parth-Brahmbhatt
Copy link
Contributor Author

This is based off of @scwf's patch #4380 so the credits should be given to him.

r(0) = r(0) + a.name + ","
r(1) = r(1) + a.dataType.typeName + ":"
r
})
Copy link
Member

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
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@HyukjinKwon
Copy link
Member

( it seems the last part of the title os truncated.)

@Parth-Brahmbhatt
Copy link
Contributor Author

@HyukjinKwon I don't understand your last comment

( it seems the last part of the title os truncated.)

@HyukjinKwon
Copy link
Member

@Parth-Brahmbhatt I think the title of this PR, [SPARK-4131] [SQL] Support INSERT OVERWRITE [LOCAL] DIRECTORY '/path/… is incomplete because it is ending with ....

@Parth-Brahmbhatt Parth-Brahmbhatt changed the title [SPARK-4131] [SQL] Support INSERT OVERWRITE [LOCAL] DIRECTORY '/path/… [SPARK-4131] [SQL] Support INSERT OVERWRITE [LOCAL] DIRECTORY '/path/to/dir' [ROW FORMAT row_format] [STORED AS file_format] query. May 12, 2016
@Parth-Brahmbhatt
Copy link
Contributor Author

@HyukjinKwon fixed.

@prongs
Copy link

prongs commented May 17, 2016

Any update on this? Seems like a useful feature.

@HyukjinKwon
Copy link
Member

HyukjinKwon commented May 18, 2016

Please let me cc @hvanhovell because it seems the most of codes were recently updated by him.

@Parth-Brahmbhatt
Copy link
Contributor Author

@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';
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@santhavathi
Copy link

Is this feature available yet?

@gatorsmile
Copy link
Member

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?

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@gatorsmile
Copy link
Member

Since this PR #18975 will be merged soon. Could you close this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants