-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-36571][SQL] Add new SQLPathHadoopMapReduceCommitProtocol resolve conflict when write into partition table's different partition #35319
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
Closed
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
6331e56
[36562][SQL] Add new NewSQLHadoopMapReduceCommitProtocol resolve conf…
AngersZhuuuu 4d80c24
Update PartitionedWriteSuite.scala
AngersZhuuuu b692e0f
Update PartitionedWriteSuite.scala
AngersZhuuuu e6dbae1
Update NewSQLHadoopMapReduceCommitProtocol.scala
AngersZhuuuu 6419573
Update NewSQLHadoopMapReduceCommitProtocol.scala
AngersZhuuuu 44d1d8f
Update PathOutputCommitProtocol.scala
AngersZhuuuu e2c5318
Update PathOutputCommitProtocol.scala
AngersZhuuuu 9106d18
update
AngersZhuuuu 2031f5b
[SPARK-36579][SQL] Make spark source stagingDir can use user defined
AngersZhuuuu c29f55e
Update SQLHadoopMapReduceCommitProtocol.scala
AngersZhuuuu 2604c9f
Update
AngersZhuuuu 71f6b17
fix ut
AngersZhuuuu 1947cbf
Merge branch 'master' into SPARK-36579
AngersZhuuuu 30113d2
Update SaveAsHiveFile.scala
AngersZhuuuu 6f405dc
update
AngersZhuuuu 361263b
update
AngersZhuuuu 9ee6ee5
update
AngersZhuuuu 7773fb2
update
AngersZhuuuu a3b3c51
Update PathOutputCommitProtocol.scala
AngersZhuuuu b4d60e4
Update PathOutputCommitProtocol.scala
AngersZhuuuu 2c41808
Update CommitterBindingSuite.scala
AngersZhuuuu 454118d
update
AngersZhuuuu 11d6d15
Update PartitionedWriteSuite.scala
AngersZhuuuu 9c9826c
update
AngersZhuuuu 5926822
update
AngersZhuuuu 6cdee58
update
AngersZhuuuu 824ec04
Update FileCommitProtocol.scala
AngersZhuuuu 8c8a174
update
AngersZhuuuu 8d7ce6e
update
AngersZhuuuu da6a0b9
update
AngersZhuuuu 63e466c
update
AngersZhuuuu fd2ac5f
update
AngersZhuuuu e2951f1
fix UT
AngersZhuuuu c8d0c33
complicated
AngersZhuuuu eafb8dd
update
AngersZhuuuu ff2bfb8
revert API change
AngersZhuuuu c5a1d16
update
AngersZhuuuu 239b2a8
Merge branch 'master' into SPARK-36562
AngersZhuuuu 6dde222
Merge branch 'SPARK-36579' into SPARK-36562
AngersZhuuuu ac468fa
update
AngersZhuuuu 09f211b
update
AngersZhuuuu f1f12c3
update
AngersZhuuuu 023787a
Update PathOutputCommitProtocol.scala
AngersZhuuuu 5984fb2
Update PathOutputCommitProtocol.scala
AngersZhuuuu c2f606f
trigger GA
AngersZhuuuu a4468c2
Merge branch 'master' into SPARK-36562
AngersZhuuuu b90caeb
Update FileCommitProtocol.scala
AngersZhuuuu 98f066c
Update FileCommitProtocol.scala
AngersZhuuuu 2ea214c
update
AngersZhuuuu 201b0b5
Update HadoopMapReduceCommitProtocol.scala
AngersZhuuuu 772bf6b
Update InsertIntoHadoopFsRelationCommand.scala
AngersZhuuuu 866681c
Update InsertIntoHadoopFsRelationCommand.scala
AngersZhuuuu aaae0f2
update
AngersZhuuuu c838dd3
Update SQLPathHadoopMapReduceCommitProtocol.scala
AngersZhuuuu 1f2222c
Update StagingInsertSuite.scala
AngersZhuuuu c3472d9
Update SQLPathHadoopMapReduceCommitProtocol.scala
AngersZhuuuu 6b44163
Update SQLPathHadoopMapReduceCommitProtocol.scala
AngersZhuuuu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...ala/org/apache/spark/sql/execution/datasources/SQLPathHadoopMapReduceCommitProtocol.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.sql.execution.datasources | ||
|
|
||
| import org.apache.hadoop.fs.Path | ||
| import org.apache.hadoop.mapreduce.{OutputCommitter, TaskAttemptContext} | ||
|
|
||
| import org.apache.spark.internal.io.FileNameSpec | ||
|
|
||
| /** | ||
| * A variant of [[SQLHadoopMapReduceCommitProtocol]] that allows specifying the actual | ||
| * Hadoop output committer using an option specified in SQLConf. | ||
| */ | ||
| class SQLPathHadoopMapReduceCommitProtocol( | ||
| jobId: String, | ||
| path: String, | ||
| dynamicPartitionOverwrite: Boolean = false) | ||
| extends SQLHadoopMapReduceCommitProtocol(jobId, path, dynamicPartitionOverwrite) { | ||
|
|
||
| // This variable only can be used after setupCommitter. | ||
| private lazy val sqlPathOutputCommitter: SQLPathOutputCommitter = | ||
| committer.asInstanceOf[SQLPathOutputCommitter] | ||
|
|
||
| override protected def setupCommitter(context: TaskAttemptContext): OutputCommitter = { | ||
| val committer = new SQLPathOutputCommitter(stagingDir, new Path(path), context) | ||
| logInfo(s"Using output committer class ${committer.getClass.getCanonicalName}") | ||
| committer | ||
| } | ||
|
|
||
| override def newTaskTempFile( | ||
| taskContext: TaskAttemptContext, | ||
| dir: Option[String], | ||
| spec: FileNameSpec): String = { | ||
| val filename = getFilename(taskContext, spec) | ||
| dir.map { d => | ||
| new Path(new Path( | ||
| sqlPathOutputCommitter.getTaskAttemptPath(taskContext), d), filename).toString | ||
| }.getOrElse { | ||
| new Path(sqlPathOutputCommitter.getTaskAttemptPath(taskContext), filename).toString | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there's no test for this in the tests that i can see...it'd be good to have that viewfs coverage tested too.