Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR][SQL] Combine the same codes in test cases #23194

Closed
wants to merge 1 commit into from

Conversation

CarolinePeng
Copy link

What changes were proposed in this pull request?

In the DDLSuit, there are four test cases have the same codes , writing a function can combine the same code.

How was this patch tested?

existing tests.

@kiszk
Copy link
Member

kiszk commented Dec 1, 2018

Good catch

@kiszk
Copy link
Member

kiszk commented Dec 1, 2018

ok to test

@@ -37,7 +37,7 @@ import org.apache.spark.internal.Logging
* tasks was performed by the ShuffleMemoryManager.
*
* @param lock a [[MemoryManager]] instance to synchronize on
* @param memoryMode the type of memory tracked by this pool (on- or off-heap)
* @param memoryMode the type of memory tracked by this pool (on-heap or off-heap)
Copy link
Member

Choose a reason for hiding this comment

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

Is this change related to this PR?

Copy link
Author

Choose a reason for hiding this comment

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

No, I think it can be modified here,so I changed it by the way.

@@ -28,7 +28,7 @@ import org.apache.spark.storage.memory.MemoryStore
* (caching).
*
* @param lock a [[MemoryManager]] instance to synchronize on
* @param memoryMode the type of memory tracked by this pool (on- or off-heap)
* @param memoryMode the type of memory tracked by this pool (on-heap or off-heap)
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@SparkQA
Copy link

SparkQA commented Dec 1, 2018

Test build #99551 has finished for PR 23194 at commit eff036c.

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

@SparkQA
Copy link

SparkQA commented Dec 3, 2018

Test build #99587 has finished for PR 23194 at commit 126ca0d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@heary-cao
Copy link
Contributor

LGTM, cc @HyukjinKwon.

test("CTAS a managed table with the existing empty directory") {
val tableLoc = new File(spark.sessionState.catalog.defaultTablePath(TableIdentifier("tab1")))
try {
protected def withTableLocation(tableNames: String)(f: File => Unit): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

How about withEmptyDirInTablePath(dirName: String)?

Copy link
Author

Choose a reason for hiding this comment

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

Ok,thank you !

protected def withTableLocation(tableNames: String)(f: File => Unit): Unit = {
val tableLoc =
new File(spark.sessionState.catalog.defaultTablePath(TableIdentifier(tableNames)))
try
Copy link
Member

@maropu maropu Dec 3, 2018

Choose a reason for hiding this comment

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

nit: try {

}
}

Copy link
Member

Choose a reason for hiding this comment

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

nit: revert this

@@ -377,41 +377,41 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {
}
}

test("CTAS a managed table with the existing empty directory") {
val tableLoc = new File(spark.sessionState.catalog.defaultTablePath(TableIdentifier("tab1")))
protected def withEmptyDirInTablePath(dirName: String)(f: File => Unit): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

private?

@maropu
Copy link
Member

maropu commented Dec 4, 2018

LGTM except for minor comments

@SparkQA
Copy link

SparkQA commented Dec 4, 2018

Test build #99644 has finished for PR 23194 at commit 867ee5e.

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

@SparkQA
Copy link

SparkQA commented Dec 4, 2018

Test build #99649 has finished for PR 23194 at commit 877751b.

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

@SparkQA
Copy link

SparkQA commented Dec 4, 2018

Test build #99652 has finished for PR 23194 at commit ac2b004.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@heary-cao
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Dec 4, 2018

Test build #99656 has finished for PR 23194 at commit ac2b004.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member

maropu commented Dec 4, 2018

thanks, merging to master!

@asfgit asfgit closed this in 93f5592 Dec 4, 2018
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
## What changes were proposed in this pull request?

In the DDLSuit, there are four test cases have the same codes , writing a function can combine the same code.

## How was this patch tested?

existing tests.

Closes apache#23194 from CarolinePeng/Update_temp.

Authored-by: 彭灿00244106 <00244106@zte.intra>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants