Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Dec 15, 2020

What changes were proposed in this pull request?

  1. Move common utility functions such as test(), withNsTable() and checkPartitions() to DDLCommandTestUtils.
  2. Place common settings such as version, catalog, defaultUsing, sparkConf to CommandSuiteBase.

Why are the changes needed?

To improve code maintenance of the unified tests.

Does this PR introduce any user-facing change?

No

How was this patch tested?

By running the affected test suites:

$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowPartitionsSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowTablesSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableAddPartitionSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite"

…/AlterTableDropPartitionSuiteBase.scala

Co-authored-by: John Bampton <jbampton@users.noreply.github.com>
@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Test build #132826 has finished for PR 30779 at commit 89e3898.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37430/

protected def catalog: String
trait AlterTableAddPartitionSuiteBase extends QueryTest with DDLCommandTestUtils {
override val command = "ALTER TABLE .. ADD PARTITION"
protected def defaultUsing: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we still have it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

protected def version: String
trait AlterTableDropPartitionSuiteBase extends QueryTest with DDLCommandTestUtils {
override val command = "ALTER TABLE .. DROP PARTITION"
protected def catalog: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

super.test(s"$command $version: " + testName, testTags: _*)(testFun)
}

protected def withNsTable(ns: String, tableName: String, cat: String = catalog)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are here, shall we make the name clearer? like withNamespaceAndTable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to withNamespaceAndTable

protected def version: String
trait ShowPartitionsSuiteBase extends QueryTest with DDLCommandTestUtils {
override val command = "SHOW PARTITIONS"
protected def catalog: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

super.test(s"$command $version: " + testName, testTags: _*)(testFun)
}

protected def withNamespaceAndTable(ns: String, tableName: String, cat: String = catalog)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nit: the parameter names for namespace and catalog are both very short(ns and cat), we should probably use t to be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the build fails, I will change this to re-trigger GA or Jenkins.

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Test build #132834 has started for PR 30779 at commit 04fd90b.

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37430/

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37436/

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37436/

@SparkQA
Copy link

SparkQA commented Dec 15, 2020

Test build #132828 has finished for PR 30779 at commit 5836e54.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait AlterTableDropPartitionSuiteBase extends QueryTest with DDLCommandTestUtils

…ified-tests

# Conflicts:
#	sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala
#	sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala
#	sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableDropPartitionSuite.scala
#	sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.scala
@cloud-fan
Copy link
Contributor

@MaxGekk can you fix the conflicts?

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37462/

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37462/

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Test build #132860 has finished for PR 30779 at commit 35dc058.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class SubqueryExec(name: String, child: SparkPlan, maxNumRows: Option[Int] = None)

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 9d9d4a8 Dec 16, 2020
@MaxGekk MaxGekk deleted the refactor-unified-tests branch February 19, 2021 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants