Skip to content
Merged
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 @@ -228,7 +228,7 @@ object ResolvedDataSource extends Logging {
sqlContext,
fileCatalog,
partitionSchema = partitionSchema,
dataSchema = dataSchema,
dataSchema = dataSchema.asNullable,
Copy link
Author

Choose a reason for hiding this comment

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

bucketSpec = bucketSpec,
format,
options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSQLContext {
readParquetFile(path.toString) { df =>
assertResult(df.schema) {
StructType(
StructField("a", BooleanType, nullable = false) ::
StructField("b", IntegerType, nullable = false) ::
StructField("a", BooleanType, nullable = true) ::
StructField("b", IntegerType, nullable = true) ::
Copy link
Author

Choose a reason for hiding this comment

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

I think we have to break this test, the reason is: before your change, SQLContext.read.parquet will create ParquetRelation directly, and it won't go through ResolvedDataSource.apply, so the returned schema is not nullable.

Nil)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.apache.spark.sql.internal.{SessionState, SQLConf}
private[sql] class TestSQLContext(sc: SparkContext) extends SQLContext(sc) { self =>

def this() {
this(new SparkContext("local[1]", "test-sql-context",
this(new SparkContext("local[2]", "test-sql-context",
new SparkConf().set("spark.sql.testkey", "true")))
}

Expand Down Expand Up @@ -63,5 +63,5 @@ private[sql] object TestSQLContext {
val overrideConfs: Map[String, String] =
Map(
// Fewer shuffle partitions to speed up testing.
SQLConf.SHUFFLE_PARTITIONS.key -> "1")
SQLConf.SHUFFLE_PARTITIONS.key -> "5")
}