Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class SparkListenerSuite extends SparkFunSuite with LocalSparkContext with Match
}

val numSlices = 16
val d = sc.parallelize(0 to 1e3.toInt, numSlices).map(w)
val d = sc.parallelize(0 to 10000, numSlices).map(w)
Copy link
Member Author

@HyukjinKwon HyukjinKwon Jan 20, 2017

Choose a reason for hiding this comment

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

I am pretty sure the deserialization time test is less flaky now assuming from the individual tests as below:

Before - 4 failures out of 5.

1 (failed)
2 (failed)
3 (failed)
4 (passed)
5 (failed)

After - 1 failure out of 7.

1 (passed)
2 (passed)
3 (passed)
4 (passed)
5 (failed)
6 (passed)
7 (passed)

d.count()
sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)
listener.stageInfos.size should be (1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ class HiveDDLSuite
sql(
s"""
|ALTER TABLE $tab ADD
|PARTITION (ds='2008-04-08', hr=11) LOCATION '$part1Path'
|PARTITION (ds='2008-04-08', hr=12) LOCATION '$part2Path'
|PARTITION (ds='2008-04-08', hr=11) LOCATION '${part1Path.toURI}'
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering what is the reason?

Copy link
Member Author

@HyukjinKwon HyukjinKwon Jan 15, 2017

Choose a reason for hiding this comment

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

It seems due to the parser. If the path is something like C:\tmp\b\c, then, it goes like C: mpbc (escaping). To deal with this, we should make it C:\\tmp\\b\\c or URI. The simplest choice seems to use URI unless it is a test dedicated to such case.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I will keep it in mind. We are not following this rule when writing the test cases.

|PARTITION (ds='2008-04-08', hr=12) LOCATION '${part2Path.toURI}'
""".stripMargin)
assert(dirSet.forall(dir => dir.listFiles == null || dir.listFiles.isEmpty))

Expand Down Expand Up @@ -1252,7 +1252,7 @@ class HiveDDLSuite
s"""
|CREATE TABLE t(id int) USING hive
|OPTIONS(fileFormat 'orc', compression 'Zlib')
|LOCATION '${path.getCanonicalPath}'
|LOCATION '${path.toURI}'
""".stripMargin)
val table = spark.sessionState.catalog.getTableMetadata(TableIdentifier("t"))
assert(DDLUtils.isHiveTable(table))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
}
}

// Some tests suing script transformation are skipped as it requires `/bin/bash` which
// can be missing or differently located.
createQueryTest("transform",
"SELECT TRANSFORM (key) USING 'cat' AS (tKey) FROM src",
skip = !TestUtils.testCommandAvailable("/bin/bash"))
Expand Down Expand Up @@ -461,7 +463,8 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
|('serialization.last.column.takes.rest'='true') USING 'cat' AS (tKey, tValue)
|ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
|WITH SERDEPROPERTIES ('serialization.last.column.takes.rest'='true') FROM src;
""".stripMargin.replaceAll(System.lineSeparator(), " "))
""".stripMargin.replaceAll(System.lineSeparator(), " "),
skip = !TestUtils.testCommandAvailable("/bin/bash"))
Copy link
Member

Choose a reason for hiding this comment

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

what's the cause we need to skip this test? perhaps add a comment to help keep a record of this?

Copy link
Member Author

@HyukjinKwon HyukjinKwon Jan 18, 2017

Choose a reason for hiding this comment

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

Script transformation such as USING 'cat' requires a hard-coded /bin/bash which seems missing or differently located on Windows (with/without Cygwin).

I will add a single de-duplicated comment around the first instance of it (there are many instances of it) if I happen to push more commits.


createQueryTest("transform with SerDe4",
"""
Expand All @@ -470,7 +473,8 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd
|('serialization.last.column.takes.rest'='true') USING 'cat' ROW FORMAT SERDE
|'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' WITH SERDEPROPERTIES
|('serialization.last.column.takes.rest'='true') FROM src;
""".stripMargin.replaceAll(System.lineSeparator(), " "))
""".stripMargin.replaceAll(System.lineSeparator(), " "),
skip = !TestUtils.testCommandAvailable("/bin/bash"))

createQueryTest("LIKE",
"SELECT * FROM src WHERE value LIKE '%1%'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class HiveSerDeSuite extends HiveComparisonTest with BeforeAndAfterAll {
|ROW FORMAT SERDE '${classOf[RegexSerDe].getCanonicalName}'
|WITH SERDEPROPERTIES ("input.regex" = "([^ ]*)\t([^ ]*)")
""".stripMargin)
sql(s"LOAD DATA LOCAL INPATH '${getHiveFile("data/files/sales.txt")}' INTO TABLE sales")
sql(s"LOAD DATA LOCAL INPATH '${getHiveFile("data/files/sales.txt").toURI}' INTO TABLE sales")
}

// table sales is not a cache table, and will be clear after reset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ class ParquetMetastoreSuite extends ParquetPartitioningTest {
test("Explicitly added partitions should be readable after load") {
withTable("test_added_partitions") {
withTempDir { src =>
val newPartitionDir = src.getCanonicalPath
val newPartitionDir = src.toURI.toString
spark.range(2).selectExpr("cast(id as string)").toDF("a").write
.mode("overwrite")
.parquet(newPartitionDir)
Expand Down Expand Up @@ -645,7 +645,7 @@ class ParquetMetastoreSuite extends ParquetPartitioningTest {
test("Non-partitioned table readable after load") {
withTable("tab") {
withTempDir { src =>
val newPartitionDir = src.getCanonicalPath
val newPartitionDir = src.toURI.toString
spark.range(2).selectExpr("cast(id as string)").toDF("a").write
.mode("overwrite")
.parquet(newPartitionDir)
Expand Down