Skip to content
Closed
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 @@ -983,4 +983,15 @@ class ParquetPartitionDiscoverySuite extends QueryTest with ParquetTest with Sha
}
}
}

test("SPARK-19005 Keep column ordering when a schema is explicitly specified") {
withTempPath { dir =>
val path = dir.getCanonicalPath
val df = Seq((1L, 2.0)).toDF("a", "b")
df.write.parquet(s"$path/a=1")
val schema = new StructType().add("a", LongType).add("b", DoubleType)
assert(spark.read.schema(schema).parquet(path).schema ===
StructType(StructField("a", LongType) :: StructField("b", DoubleType) :: Nil))
}
}
}