You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by ericl <gi...@git.apache.org> on 2017/01/12 00:12:00 UTC
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
GitHub user ericl opened a pull request:
https://github.com/apache/spark/pull/16554
[SPARK-19183] [SQL] Add deleteWithJob hook to internal commit protocol API
## What changes were proposed in this pull request?
Currently in SQL we implement overwrites by calling fs.delete() directly on the original data. This is not ideal since we the original files end up deleted even if the job aborts. We should extend the commit protocol to allow file overwrites to be managed as well.
## How was this patch tested?
Existing tests. I also fixed a bunch of tests that were depending on the commit protocol implementation being set to the legacy mapreduce one.
cc @rxin @cloud-fan
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ericl/spark add-delete-protocol
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16554.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16554
----
commit 669d36bc71bcdc3e00bad9f416fcf3d9b9103136
Author: Eric Liang <ek...@databricks.com>
Date: 2017-01-11T19:52:54Z
Wed Jan 11 15:05:16 PST 2017
commit d7168e6a98537477ba4c8053de088df17415ab5f
Author: Eric Liang <ek...@databricks.com>
Date: 2017-01-11T22:13:58Z
Pull in changes to add delete api
commit c74aa88e815887947fc1406efbbe868902435228
Author: Eric Liang <ek...@databricks.com>
Date: 2017-01-11T23:58:02Z
fix tests that depend on the protocol config
commit 4e2fd96f5282d2f44c543d58ddddb8aa6c728980
Author: Eric Liang <ek...@databricks.com>
Date: 2017-01-12T00:04:59Z
Wed Jan 11 16:04:59 PST 2017
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16554
Merged build finished. Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16554
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71234/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16554
**[Test build #71234 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71234/testReport)** for PR 16554 at commit [`80e0d00`](https://github.com/apache/spark/commit/80e0d0059240642494c8f85f88a66b8a9237409c).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by ericl <gi...@git.apache.org>.
Github user ericl commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95704748
--- Diff: core/src/main/scala/org/apache/spark/internal/io/FileCommitProtocol.scala ---
@@ -112,6 +113,15 @@ abstract class FileCommitProtocol {
* just crashes (or killed) before it can call abort.
*/
def abortTask(taskContext: TaskAttemptContext): Unit
+
+ /**
+ * Specifies that a file should be deleted with the commit of this job. The default
+ * implementation deletes the file immediately, but this may be overriden to delay the physical
+ * deletion of the file until commit time.
--- End diff --
Yeah I guess that's implementation-specific. Removed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16554
**[Test build #71233 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71233/testReport)** for PR 16554 at commit [`c60dd8b`](https://github.com/apache/spark/commit/c60dd8b63b1eb1437d71885eaaefb3b34e4d1d9f).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by ericl <gi...@git.apache.org>.
Github user ericl commented on the issue:
https://github.com/apache/spark/pull/16554
These are tests broken when you swap out the file commit protocol for our
internal implementation.
On Wed, Jan 11, 2017, 7:41 PM Wenchen Fan <no...@github.com> wrote:
> @ericl <https://github.com/ericl> why did we pass all tests before?
>
> \u2014
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/spark/pull/16554#issuecomment-272068197>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAA6Sl9QdWIiKRerp5nn4SCsXWqDT1Vpks5rRaDrgaJpZM4LhOfC>
> .
>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95718174
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/HadoopFsRelationSuite.scala ---
@@ -31,7 +31,7 @@ class HadoopFsRelationSuite extends QueryTest with SharedSQLContext {
// ignore hidden files
val allFiles = dir.listFiles(new FilenameFilter {
override def accept(dir: File, name: String): Boolean = {
- !name.startsWith(".")
+ !name.startsWith(".") && !name.startsWith("_")
--- End diff --
why we add `!name.startsWith("_")`? Did we break anything before?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:
https://github.com/apache/spark/pull/16554
@ericl why did we pass all tests before?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by ericl <gi...@git.apache.org>.
Github user ericl commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95715947
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala ---
@@ -175,7 +178,7 @@ case class InsertIntoHadoopFsRelationCommand(
}
// first clear the path determined by the static partition keys (e.g. /table/foo=1)
val staticPrefixPath = qualifiedOutputPath.suffix(staticPartitionPrefix)
- if (fs.exists(staticPrefixPath) && !fs.delete(staticPrefixPath, true /* recursively */)) {
+ if (fs.exists(staticPrefixPath) && !committer.deleteWithJob(fs, staticPrefixPath, true)) {
--- End diff --
Yeah, this PR is a no-op since the current implementation just deletes the file immediately.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16554
Merged build finished. Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:
https://github.com/apache/spark/pull/16554
LGTM, merging to master!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by ericl <gi...@git.apache.org>.
Github user ericl commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95702064
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala ---
@@ -462,16 +463,19 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSQLContext {
}
test("SPARK-8121: spark.sql.parquet.output.committer.class shouldn't be overridden") {
- val extraOptions = Map(
- SQLConf.OUTPUT_COMMITTER_CLASS.key -> classOf[ParquetOutputCommitter].getCanonicalName,
- "spark.sql.parquet.output.committer.class" ->
- classOf[JobCommitFailureParquetOutputCommitter].getCanonicalName
- )
- withTempPath { dir =>
- val message = intercept[SparkException] {
- spark.range(0, 1).write.options(extraOptions).parquet(dir.getCanonicalPath)
- }.getCause.getMessage
- assert(message === "Intentional exception for testing purposes")
+ withSQLConf(SQLConf.FILE_COMMIT_PROTOCOL_CLASS.key ->
+ classOf[SQLHadoopMapReduceCommitProtocol].getCanonicalName) {
--- End diff --
Here and below, the tests were indented verbatim.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95702468
--- Diff: core/src/main/scala/org/apache/spark/internal/io/FileCommitProtocol.scala ---
@@ -112,6 +113,15 @@ abstract class FileCommitProtocol {
* just crashes (or killed) before it can call abort.
*/
def abortTask(taskContext: TaskAttemptContext): Unit
+
+ /**
+ * Specifies that a file should be deleted with the commit of this job. The default
+ * implementation deletes the file immediately, but this may be overriden to delay the physical
+ * deletion of the file until commit time.
--- End diff --
is this api extension going open source soon? if yes, we probably don't want to document it this way (just remove everything after ", but")
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by ericl <gi...@git.apache.org>.
Github user ericl commented on the issue:
https://github.com/apache/spark/pull/16554
The test was not properly ignoring hidden files, e.g. _SUCCESS markers.
On Wed, Jan 11, 2017, 7:09 PM UCB AMPLab <no...@github.com> wrote:
> Merged build finished. Test PASSed.
>
> \u2014
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/spark/pull/16554#issuecomment-272064135>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAA6SvYu1xHp128RjD8knhRySlHAFCE2ks5rRZlzgaJpZM4LhOfC>
> .
>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/16554
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16554
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71233/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16554
**[Test build #71234 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71234/testReport)** for PR 16554 at commit [`80e0d00`](https://github.com/apache/spark/commit/80e0d0059240642494c8f85f88a66b8a9237409c).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to int...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16554#discussion_r95713575
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala ---
@@ -175,7 +178,7 @@ case class InsertIntoHadoopFsRelationCommand(
}
// first clear the path determined by the static partition keys (e.g. /table/foo=1)
val staticPrefixPath = qualifiedOutputPath.suffix(staticPartitionPrefix)
- if (fs.exists(staticPrefixPath) && !fs.delete(staticPrefixPath, true /* recursively */)) {
+ if (fs.exists(staticPrefixPath) && !committer.deleteWithJob(fs, staticPrefixPath, true)) {
--- End diff --
so we still delete the files before overwrite?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16554: [SPARK-19183] [SQL] Add deleteWithJob hook to internal c...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16554
**[Test build #71233 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71233/testReport)** for PR 16554 at commit [`c60dd8b`](https://github.com/apache/spark/commit/c60dd8b63b1eb1437d71885eaaefb3b34e4d1d9f).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org