GitHub user tdas opened a pull request:
https://github.com/apache/spark/pull/12517
[SPARK-14741][SQL] Fixed error in reading json file stream inside a
partitioned directory
## What changes were proposed in this pull request?
Consider the following directory structure
dir/col=X/some-files
If we create a text format streaming dataframe on `dir/col=X/` then it
should not consider as partitioning in columns. Even though the streaming
dataframe does not do so, the generated batch dataframes pick up col as a
partitioning columns, causing mismatch streaming source schema and generated df
schema. This leads to runtime failure:
```
18:55:11.262 ERROR
org.apache.spark.sql.execution.streaming.StreamExecution: Query query-0
terminated with error
java.lang.AssertionError: assertion failed: Invalid batch: c#2 != c#7,type#8
```
The reason is that the partition inferring code has no idea of a base path,
above which it should not search of partitions. This PR makes sure that the
batch DF is generated with the basePath set as the original path on which the
file stream source is defined.
## How was this patch tested?
New unit test
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tdas/spark SPARK-14741
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12517.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 #12517
----
commit a33c29a94c76eb1d170059b270cdf0151afbf513
Author: Tathagata Das <[email protected]>
Date: 2016-04-20T02:21:35Z
Fixed bug
----
---
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]