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 @@ -121,7 +121,8 @@ class ListingFileCatalog(
}

override def equals(other: Any): Boolean = other match {
case hdfs: ListingFileCatalog => paths.toSet == hdfs.paths.toSet
case hdfs: ListingFileCatalog =>
cachedLeafDirToChildrenFiles == hdfs.cachedLeafDirToChildrenFiles
case _ => false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ class ParquetQuerySuite extends QueryTest with ParquetTest with SharedSQLContext
TableIdentifier("tmp"), ignoreIfNotExists = true)
}

test("SPARK-15678: not use cache on overwrite") {
withTempDir { dir =>
val path = dir.toString
spark.range(1000).write.mode("overwrite").parquet(path)
val df = spark.read.parquet(path).cache()
assert(df.count() == 1000)
spark.range(10).write.mode("overwrite").parquet(path)
assert(df.count() == 1000)
assert(spark.read.parquet(path).count() == 10)
}
}

test("SPARK-15678: not use cache on append") {
withTempDir { dir =>
val path = dir.toString
spark.range(1000).write.mode("append").parquet(path)
val df = spark.read.parquet(path).cache()
assert(df.count() == 1000)
spark.range(10).write.mode("append").parquet(path)
assert(df.count() == 1000)
assert(spark.read.parquet(path).count() == 1010)
}
}

test("self-join") {
// 4 rows, cells of column 1 of row 2 and row 4 are null
val data = (1 to 4).map { i =>
Expand Down