Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[SPARK-2817] fix the line length problem
  • Loading branch information
tianyi committed Aug 8, 2014
commit 9b2ba1179c5dcc61d953dc26b544ced2c8c3786d
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {
set("hive.metastore.warehouse.dir", warehousePath)
}

val testTmpDir = if (System.getProperty("user.dir").endsWith("sql" + File.separator + "hive")) {
val testTmpDir = if (System.getProperty("user.dir").endsWith("sql" +
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this just be:

val testTempDir = File.createtempfile("", "spark.hive.tmp")
testTempDir.delete()
testTempDir.mkdir()

I'm not sure why we would want to keep temporary files in the source tree instead of the system temporary folder.

File.separator + "hive")) {
new File(System.getProperty("user.dir") + File.separator + "tmp")
Copy link
Contributor

Choose a reason for hiding this comment

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

All we need is the temporal folder, not sure why we have to check the user working directory if end with sql/hive,
Can we just use val testTmpDir = new File(System.getProperty("user.dir") + File.separator + "tmp") instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chenghao-intel I did not understand why we have to check that too. I just follow the same way of handling "inRepoTests"

Copy link
Contributor

Choose a reason for hiding this comment

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

in repo tests is checking to see if the tests are there or if we should look for them in the hive distribution (they weren't always bundled with the source tree). If we need a temporary directory, we should use the mechanisms provided by the JVM for that (File.createTempFile)

} else {
new File(System.getProperty("user.dir") + File.separator + "sql" + File.separator + "hive" + File.separator + "tmp")
new File(System.getProperty("user.dir") + File.separator + "sql" +
File.separator + "hive" + File.separator + "tmp")
}

configure() // Must be called before initializing the catalog below.
Expand Down