MaxGekk commented on a change in pull request #31092:
URL: https://github.com/apache/spark/pull/31092#discussion_r553904361
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenamePartitionSuite.scala
##########
@@ -25,4 +25,20 @@ import org.apache.spark.sql.execution.command.v1
*/
class AlterTableRenamePartitionSuite
extends v1.AlterTableRenamePartitionSuiteBase
- with CommandSuiteBase
+ with CommandSuiteBase {
+
+ test("hive client calls") {
+ 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")
+
+ checkHiveClientCalls(expected = 21) {
Review comment:
The number is huge because there are a lot of checks like the same table
exists (repeats many times) and loading of the table/its metadata from Hive
catalog.
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableAddPartitionSuite.scala
##########
@@ -24,5 +24,21 @@ import org.apache.spark.sql.execution.command.v1
* V1 Hive external table catalog.
*/
class AlterTableAddPartitionSuite
- extends v1.AlterTableAddPartitionSuiteBase
- with CommandSuiteBase
+ extends v1.AlterTableAddPartitionSuiteBase
+ with CommandSuiteBase {
+
+ test("hive client calls") {
+ 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")
+
+ checkHiveClientCalls(expected = 14) {
+ sql(s"ALTER TABLE $t ADD PARTITION (part=1)")
+ }
+ sql(s"CACHE TABLE $t")
+ checkHiveClientCalls(expected = 14) {
Review comment:
The number is the same because `ALTER TABLE .. ADD PARTITION` doesn't
refresh the cache. I am going to address this issue soon.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]