GitHub user xwu0226 opened a pull request:
https://github.com/apache/spark/pull/14509
[SPARK-16924][SQL] - Support option("inferSchema", true) option for
DataStreamReadder
## What changes were proposed in this pull request?
The issue is that `DataSource.sourceSchema()` has a check against only the
SQLConf setting `spark.sql.streaming.schemaInference`, which is only set at the
Session level. So even though the user specify `option("inferSchema", true)` as
they would usually do for `DataFrameReader` for csv/json file,
DataSource.sourceSchema() does not know. and this option is not passed down to
`CSVFileFormat.inferSchema`.
This PR is to combine the checking of both the value of
`spark.sql.streaming.schemaInference` and the `option("inferSchema")`.
## How was this patch tested?
New unit test added to test creating streaming DataSet with
`option("inferSchema", true)`
And ran the regression buckets.
(If this patch involves UI changes, please attach a screenshot; otherwise,
remove this)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/xwu0226/spark INFERSCHEMA_OPTION
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14509.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14509
----
commit 8692d1ca2d0e685dc752e9996637cd1189043557
Author: Xin Wu <[email protected]>
Date: 2016-08-05T18:52:54Z
Support option("inferSchema", true) option for DataStreamReadder
----
---
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]