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/04 20:36:23 UTC
[GitHub] [spark] MaxGekk opened a new pull request #31017: [SPARK-33987][SQL] Refresh cache in v2 `ALTER TABLE .. DROP PARTITION`
MaxGekk opened a new pull request #31017:
URL: https://github.com/apache/spark/pull/31017
### What changes were proposed in this pull request?
1. Refresh the cache associated with tables from v2 table catalogs in the `ALTER TABLE .. DROP PARTITION` command.
2. Port the test for v1 catalogs to the base suite to run it for v2 table catalog.
### Why are the changes needed?
The changes fix incorrect query results from cached V2 table altered by `ALTER TABLE .. DROP PARTITION`, see the added test and SPARK-33987.
### Does this PR introduce _any_ user-facing change?
Yes, it could if users have v2 table catalogs.
### How was this patch tested?
By running unified tests for `ALTER TABLE .. DROP PARTITION`:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite"
```
----------------------------------------------------------------
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] dongjoon-hyun closed pull request #31017: [SPARK-33987][SQL] Refresh cache in v2 `ALTER TABLE .. DROP PARTITION`
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31017:
URL: https://github.com/apache/spark/pull/31017
----------------------------------------------------------------
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 #31017: [SPARK-33987][SQL] Refresh cache in v2 `ALTER TABLE .. DROP PARTITION`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31017:
URL: https://github.com/apache/spark/pull/31017#issuecomment-754209540
@cloud-fan @dongjoon-hyun @stczwd @sunchao @imback82 May I ask you to review 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
[GitHub] [spark] MaxGekk commented on a change in pull request #31017: [SPARK-33987][SQL] Refresh cache in v2 `ALTER TABLE .. DROP PARTITION`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #31017:
URL: https://github.com/apache/spark/pull/31017#discussion_r551567165
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala
##########
@@ -155,4 +155,19 @@ trait AlterTableDropPartitionSuiteBase extends QueryTest with DDLCommandTestUtil
QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(1, 1)))
}
}
+
+ test("SPARK-33950, SPARK-33987: refresh cache after partition dropping") {
+ withNamespaceAndTable("ns", "tbl") { t =>
+ sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)")
+ sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0")
+ sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1")
+ assert(!spark.catalog.isCached(t))
+ sql(s"CACHE TABLE $t")
+ assert(spark.catalog.isCached(t))
+ QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1)))
Review comment:
I had to add `QueryTest` to `checkAnswer` because I got pretty weird error when I run the test as part of Hive's test suite:
```
[info] org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite *** ABORTED *** (19 seconds, 910 milliseconds)
[info] java.lang.AbstractMethodError: Method org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.org$apache$spark$sql$execution$command$AlterTableDropPartitionSuiteBase$$super$checkAnswer(Lscala/Function0;Lscala/collection/Seq;)V is abstract
[info] at org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite.org$apache$spark$sql$execution$command$AlterTableDropPartitionSuiteBase$$super$checkAnswer(AlterTableDropPartitionSuite.scala)
```
I don't have any clues what's going on here because `checkAnswer` from the `QueryTest` is defined, and it is not abstact.
----------------------------------------------------------------
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