Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/8228#discussion_r37147799
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/CatalystSchemaConverter.scala
---
@@ -72,18 +72,9 @@ private[parquet] class CatalystSchemaConverter(
followParquetFormatSpec = conf.followParquetFormatSpec)
def this(conf: Configuration) = this(
- assumeBinaryIsString =
- conf.getBoolean(
- SQLConf.PARQUET_BINARY_AS_STRING.key,
- SQLConf.PARQUET_BINARY_AS_STRING.defaultValue.get),
- assumeInt96IsTimestamp =
- conf.getBoolean(
- SQLConf.PARQUET_INT96_AS_TIMESTAMP.key,
- SQLConf.PARQUET_INT96_AS_TIMESTAMP.defaultValue.get),
- followParquetFormatSpec =
- conf.getBoolean(
- SQLConf.PARQUET_FOLLOW_PARQUET_FORMAT_SPEC.key,
- SQLConf.PARQUET_FOLLOW_PARQUET_FORMAT_SPEC.defaultValue.get))
+ assumeBinaryIsString =
conf.get(SQLConf.PARQUET_BINARY_AS_STRING.key).toBoolean,
+ assumeInt96IsTimestamp =
conf.get(SQLConf.PARQUET_INT96_AS_TIMESTAMP.key).toBoolean,
+ followParquetFormatSpec =
conf.get(SQLConf.PARQUET_FOLLOW_PARQUET_FORMAT_SPEC.key).toBoolean)
--- End diff --
These three configurations should always be set. Removed default values to
ensure that these configurations are actually set in `ParquetRelation`. I'd
rather it crashes instead of giving wrong schema (and wrong data).
---
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]