Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/4826#discussion_r25561497
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala ---
@@ -172,9 +173,14 @@ private[sql] object ParquetRelation {
sqlContext.conf.parquetCompressionCodec.toUpperCase,
CompressionCodecName.UNCOMPRESSED)
.name())
ParquetRelation.enableLogForwarding()
- ParquetTypesConverter.writeMetaData(attributes, path, conf)
+ // This is a hack. We always set
nullable/containsNull/valueContainsNull to true
+ // for the schema of a parquet data.
+ val schema =
+
DataType.alwaysNullable(StructType.fromAttributes(attributes)).asInstanceOf[StructType]
+ val newAttributes = schema.toAttributes
+ ParquetTypesConverter.writeMetaData(newAttributes, path, conf)
new ParquetRelation(path.toString, Some(conf), sqlContext) {
- override val output = attributes
+ override val output = newAttributes
--- End diff --
@liancheng @marmbrus I am also changing the nullability for our old parquet
write path to make the behavior consistent with our new write path. Let me know
if there is any potential compatibility issue and we should revert this change.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]