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/01/10 16:16:58 UTC
[GitHub] [spark] MaxGekk opened a new pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
MaxGekk opened a new pull request #31114:
URL: https://github.com/apache/spark/pull/31114
### What changes were proposed in this pull request?
Replace the code for updating of table stats by `updateTableStats()` in `AlterTableAddPartitionCommand.run()`. This follows the same approach as in `AlterTableDropPartitionCommand.run()`
### Why are the changes needed?
To improve code maintenance.
### Does this PR introduce _any_ user-facing change?
Should not.
### How was this patch tested?
By running unified tests for `ALTER TABLE .. ADD PARTITION`:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"
```
----------------------------------------------------------------
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.
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] SparkQA commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757509670
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38485/
----------------------------------------------------------------
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.
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] SparkQA commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757547256
**[Test build #133896 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133896/testReport)** for PR 31114 at commit [`f5a7958`](https://github.com/apache/spark/commit/f5a79586d16532876202cb010c4aa4e32a5a3fa1).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
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.
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] cloud-fan commented on a change in pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #31114:
URL: https://github.com/apache/spark/pull/31114#discussion_r555016854
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -486,18 +486,8 @@ case class AlterTableAddPartitionCommand(
}
sparkSession.catalog.refreshTable(table.identifier.quotedString)
- if (table.stats.nonEmpty) {
- if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
- val addedSize = CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,
Review comment:
can we do that first? otherwise this PR may introduce perf regression.
----------------------------------------------------------------
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.
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] MaxGekk commented on a change in pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #31114:
URL: https://github.com/apache/spark/pull/31114#discussion_r554605596
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -486,18 +486,8 @@ case class AlterTableAddPartitionCommand(
}
sparkSession.catalog.refreshTable(table.identifier.quotedString)
- if (table.stats.nonEmpty) {
- if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
- val addedSize = CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,
Review comment:
You are right. I think we could do similar optimization in `updateTableStats` by comparing new size with existing one in `CatalogTable`. So, the optimization can be picked up by other commands.
----------------------------------------------------------------
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.
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] MaxGekk commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-759432954
> can you take an action to the JIRA too?
@HyukjinKwon I closed it but kept it unassigned since I don't have enough permissions to change the field.
----------------------------------------------------------------
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.
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] MaxGekk commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-758202758
Alter carefully looking into `updateTableStats()`, I think this PR can cause perf regression because `updateTableStats()` re-calculate size of the entire table but existing code does that only for new partition.
----------------------------------------------------------------
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.
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] MaxGekk commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-759261851
I am closing this because https://github.com/apache/spark/pull/31149 invokes `updateTableStats()` already.
----------------------------------------------------------------
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.
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] MaxGekk commented on a change in pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #31114:
URL: https://github.com/apache/spark/pull/31114#discussion_r555301617
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -486,18 +486,8 @@ case class AlterTableAddPartitionCommand(
}
sparkSession.catalog.refreshTable(table.identifier.quotedString)
- if (table.stats.nonEmpty) {
- if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
- val addedSize = CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,
Review comment:
Here is the PR https://github.com/apache/spark/pull/31135
----------------------------------------------------------------
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.
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 removed a comment on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757511890
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38485/
----------------------------------------------------------------
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.
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] SparkQA commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757509099
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38485/
----------------------------------------------------------------
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.
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] cloud-fan commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-758414354
is there a way to make `updateTableStats()` more generic so that it can be used in ADD PARTITION without perf regression?
----------------------------------------------------------------
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.
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] HyukjinKwon commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-759421275
@MaxGekk, can you take an action to the JIRA too?
----------------------------------------------------------------
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.
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] SparkQA removed a comment on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757504004
**[Test build #133896 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133896/testReport)** for PR 31114 at commit [`f5a7958`](https://github.com/apache/spark/commit/f5a79586d16532876202cb010c4aa4e32a5a3fa1).
----------------------------------------------------------------
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.
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] sunchao commented on a change in pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
sunchao commented on a change in pull request #31114:
URL: https://github.com/apache/spark/pull/31114#discussion_r554604130
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -486,18 +486,8 @@ case class AlterTableAddPartitionCommand(
}
sparkSession.catalog.refreshTable(table.identifier.quotedString)
- if (table.stats.nonEmpty) {
- if (sparkSession.sessionState.conf.autoSizeUpdateEnabled) {
- val addedSize = CommandUtils.calculateMultipleLocationSizes(sparkSession, table.identifier,
Review comment:
I think this avoids the external catalog call if `addedSize` is 0, which `updateTableStats` doesn't do, but I guess in most cases `addedSize` should be > 0.
----------------------------------------------------------------
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.
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] SparkQA commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757504004
**[Test build #133896 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133896/testReport)** for PR 31114 at commit [`f5a7958`](https://github.com/apache/spark/commit/f5a79586d16532876202cb010c4aa4e32a5a3fa1).
----------------------------------------------------------------
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.
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] MaxGekk closed pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #31114:
URL: https://github.com/apache/spark/pull/31114
----------------------------------------------------------------
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.
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] MaxGekk edited a comment on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk edited a comment on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-758202758
Alter carefully looking into `updateTableStats()`, I think this PR can cause perf regression because `updateTableStats()` re-calculate size of the entire table but existing code does that only for new partition.
Just in case, we can optimize `ALTER TABLE .. DROP PARTITION` by calculating size of dropped partition only but not entire table.
----------------------------------------------------------------
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.
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 removed a comment on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757547487
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133896/
----------------------------------------------------------------
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.
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 #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757547487
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/133896/
----------------------------------------------------------------
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.
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 #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757511890
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38485/
----------------------------------------------------------------
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.
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] MaxGekk commented on pull request #31114: [SPARK-34062][SQL] Call `updateTableStats()` from `AlterTableAddPartitionCommand`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31114:
URL: https://github.com/apache/spark/pull/31114#issuecomment-757828167
@cloud-fan @HyukjinKwon Please, have a look at this PR.
----------------------------------------------------------------
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.
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