You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/11/05 07:47:12 UTC
[GitHub] [spark] wForget opened a new pull request #34489: [SPARK-37210] Write to static partition in dynamic write mode
wForget opened a new pull request #34489:
URL: https://github.com/apache/spark/pull/34489
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
When using static partition writing, dynamicPartitionOverwrite should also be set to true. See [SPARK-37210](https://issues.apache.org/jira/browse/SPARK-37210) for details
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
An error occurred while concurrently writing to different static partitions.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
See [SPARK-37210](https://issues.apache.org/jira/browse/SPARK-37210) for specific test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-967199860
There seem to be two bugs:
1. For the insert overwrite fully static partition, when the insert data size is 0, the existing partition data will be deleted.
2. For concurrent writes to fully static partitions, exceptions may occur in `insert into` or `insert overwrite`. Due to temporary path '${tableLocation}/_temporary' will be deleted in `FileOutputCommitter.cleanupJob`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] github-actions[bot] closed pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #34489:
URL: https://github.com/apache/spark/pull/34489
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r748379231
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
Review comment:
> This PR aims to support concurrent write for INSERT OVERWRITE only. Do we support non-overwrite INSERT case?
Concurrent write in `INSERT INTO` mode seems to have the same problem, but this pr does not fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r759917283
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHiveSingleton.scala
##########
@@ -27,9 +27,9 @@ import org.apache.spark.sql.hive.client.HiveClient
trait TestHiveSingleton extends SparkFunSuite with BeforeAndAfterAll {
override protected val enableAutoThreadAudit = false
- protected val spark: SparkSession = TestHive.sparkSession
- protected val hiveContext: TestHiveContext = TestHive
- protected val hiveClient: HiveClient =
+ protected lazy val spark: SparkSession = TestHive.sparkSession
+ protected lazy val hiveContext: TestHiveContext = TestHive
+ protected lazy val hiveClient: HiveClient =
Review comment:
Could you add some comment to explain why these three `lazy` are required, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34489: [SPARK-37210] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-961687921
Can one of the admins verify this patch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r759917788
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +172,30 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
+ System.setProperty("spark.sql.test.master", "local[10]")
+ import testImplicits._
+ withSQLConf(SQLConf.LEAF_NODE_DEFAULT_PARALLELISM.key -> "1",
+ SQLConf.MAX_RECORDS_PER_FILE.key -> "1000") {
+ withTable("t") {
+ (1 to 10000).map(i => (i, i))
+ .toDF("_1", "_2").createOrReplaceTempView("s")
Review comment:
If possible, one liner would be better.
```scala
(1 to 10000).map(i => (i, i)).toDF("_1", "_2").createOrReplaceTempView("s")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] github-actions[bot] commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1065703130
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071992284
` // For dynamic partition overwrite, FileOutputCommitter's output path is staging path, files
// will be renamed from staging path to final output path during commit job
val committerOutputPath = if (dynamicPartitionOverwrite) {
FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
.makeQualified(fs.getUri, fs.getWorkingDirectory)
} else {
qualifiedOutputPath
}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071991548
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r747810048
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
Review comment:
This PR aims to support concurrent write for `INSERT OVERWRITE` only. Do we support non-overwrite INSERT case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-967210575
> Ur, @wForget . The test case passed on `master` branch without your patch. It looks like an invalid test case for your contribution.
I made some adjustments to the test cases to make it more likely to conflict and lead to exception.
1. Increase the size of the inserted data.
2. Different tasks write different data sizes, so that the task execution duration is different.
3. Modify the `spark.sql.test.master` configuration to execute tasks in parallel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-983370521
> Could you put your findings into the PR description?
>
> * [[SPARK-37210][SQL] Write to static partition in dynamic write modeĀ #34489 (comment)](https://github.com/apache/spark/pull/34489#issuecomment-967199860)
> * [[SPARK-37210][SQL] Write to static partition in dynamic write modeĀ #34489 (comment)](https://github.com/apache/spark/pull/34489#issuecomment-967210575)
>
> The PR description will be a permanent commit log.
Thank you for your reminder, I will do that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r748379231
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
Review comment:
> non-overwrite
Concurrent write in `INSERT INTO` mode seems to have the same problem, but this pr does not fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r759917283
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHiveSingleton.scala
##########
@@ -27,9 +27,9 @@ import org.apache.spark.sql.hive.client.HiveClient
trait TestHiveSingleton extends SparkFunSuite with BeforeAndAfterAll {
override protected val enableAutoThreadAudit = false
- protected val spark: SparkSession = TestHive.sparkSession
- protected val hiveContext: TestHiveContext = TestHive
- protected val hiveClient: HiveClient =
+ protected lazy val spark: SparkSession = TestHive.sparkSession
+ protected lazy val hiveContext: TestHiveContext = TestHive
+ protected lazy val hiveClient: HiveClient =
Review comment:
Could you add some comment to explain why these `lazy` are required, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-983366425
Could you put your findings into the PR description?
- https://github.com/apache/spark/pull/34489#issuecomment-967199860
- https://github.com/apache/spark/pull/34489#issuecomment-967210575
The PR description will be a permanent commit log.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34489: [SPARK-37210] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-961687921
Can one of the admins verify this patch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 edited a comment on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 edited a comment on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071992284
here
```
// For dynamic partition overwrite, FileOutputCommitter's output path is staging path, files
// will be renamed from staging path to final output path during commit job
val committerOutputPath = if (dynamicPartitionOverwrite) {
FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
.makeQualified(fs.getUri, fs.getWorkingDirectory)
} else {
qualifiedOutputPath
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r747811433
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
+ withTable("t") {
+ sql("CREATE TABLE t (c1 int, c2 int) PARTITIONED BY (c3 int, c4 int) STORED AS PARQUET")
+ val selectStatement = "SELECT 1 AS c1, 2 AS c2"
+ val tasks: Seq[Callable[Unit]] = (1 to 4).map(i => {
+ new Callable[Unit] {
+ override def call(): Unit = {
+ sql(s"INSERT OVERWRITE TABLE t PARTITION(c3=3$i, c4=4$i) $selectStatement")
Review comment:
Shall we simplify this by using `VALUES` instead of `$selectStatement`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r759919910
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHiveSingleton.scala
##########
@@ -27,9 +27,9 @@ import org.apache.spark.sql.hive.client.HiveClient
trait TestHiveSingleton extends SparkFunSuite with BeforeAndAfterAll {
override protected val enableAutoThreadAudit = false
- protected val spark: SparkSession = TestHive.sparkSession
- protected val hiveContext: TestHiveContext = TestHive
- protected val hiveClient: HiveClient =
+ protected lazy val spark: SparkSession = TestHive.sparkSession
+ protected lazy val hiveContext: TestHiveContext = TestHive
+ protected lazy val hiveClient: HiveClient =
Review comment:
> Could you add some comment to explain why these three lazy are required, please?
OK, I want to make the spark.sql.test.master configuration effective in the test case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071991548
@wForget @dongjoon-hyun The same problem occur to me too, but I think should we change `committerOutputPath` of static-wirte to dynamic-write one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 removed a comment on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 removed a comment on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071992284
here
```
// For dynamic partition overwrite, FileOutputCommitter's output path is staging path, files
// will be renamed from staging path to final output path during commit job
val committerOutputPath = if (dynamicPartitionOverwrite) {
FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
.makeQualified(fs.getUri, fs.getWorkingDirectory)
} else {
qualifiedOutputPath
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r759919225
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
Review comment:
Do we have a JIRA issue for that? If not, could you file one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34489: [SPARK-37210] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-961687921
Can one of the admins verify this patch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] wForget commented on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
wForget commented on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-962603101
> Could you add a test case, @wForget ?
Hi @dongjoon-hyun , I have added a test case, can you help me review it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 edited a comment on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 edited a comment on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071992284
here
```
// For dynamic partition overwrite, FileOutputCommitter's output path is staging path, files
// will be renamed from staging path to final output path during commit job
val committerOutputPath = if (dynamicPartitionOverwrite) {
FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
.makeQualified(fs.getUri, fs.getWorkingDirectory)
} else {
qualifiedOutputPath
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Resol1992 removed a comment on pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
Resol1992 removed a comment on pull request #34489:
URL: https://github.com/apache/spark/pull/34489#issuecomment-1071992284
here
```
// For dynamic partition overwrite, FileOutputCommitter's output path is staging path, files
// will be renamed from staging path to final output path during commit job
val committerOutputPath = if (dynamicPartitionOverwrite) {
FileCommitProtocol.getStagingDir(outputPath.toString, jobId)
.makeQualified(fs.getUri, fs.getWorkingDirectory)
} else {
qualifiedOutputPath
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #34489: [SPARK-37210][SQL] Write to static partition in dynamic write mode
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #34489:
URL: https://github.com/apache/spark/pull/34489#discussion_r747812090
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
##########
@@ -168,4 +170,23 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton
}
}
}
+
+ test("SPARK-37210: Concurrent write to different static partitions") {
+ withTable("t") {
+ sql("CREATE TABLE t (c1 int, c2 int) PARTITIONED BY (c3 int, c4 int) STORED AS PARQUET")
+ val selectStatement = "SELECT 1 AS c1, 2 AS c2"
+ val tasks: Seq[Callable[Unit]] = (1 to 4).map(i => {
+ new Callable[Unit] {
+ override def call(): Unit = {
+ sql(s"INSERT OVERWRITE TABLE t PARTITION(c3=3$i, c4=4$i) $selectStatement")
+ }
+ }
+ })
+ import scala.collection.JavaConverters._
Review comment:
Please move this to the import section at the beginning of this file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org