GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/19094
[SPARK-21884][SQL] Fix StackOverflowError on MetadataOnlyQuery
## What changes were proposed in this pull request?
This PR aims to fix StackOverflowError in `branch-2.2`. This happens when
`OptimizeMetadataOnlyQuery` returns `LocalRelation` with partition informations
without materializations. `master` branch has the same logic, but it doesn't
throw StackOverflowError due to the other patches.
```scala
scala> spark.version
res0: String = 2.2.0
scala> sql("CREATE TABLE t_1000 (a INT, p INT) USING PARQUET PARTITIONED BY
(p)")
res1: org.apache.spark.sql.DataFrame = []
scala> (1 to 1000).foreach(p => sql(s"ALTER TABLE t_1000 ADD PARTITION
(p=$p)"))
scala> sql("SELECT COUNT(DISTINCT p) FROM t_1000").collect
java.lang.StackOverflowError
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1522)
```
## How was this patch tested?
Pass the Jenkins with a new test case.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-21884
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19094.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 #19094
----
commit 07126f7f0ab0eb05d312b93d9b3f0b6592770345
Author: Dongjoon Hyun <[email protected]>
Date: 2017-08-31T10:08:13Z
[SPARK-21884][SQL] Fix StackOverflowError on MetadataOnlyQuery
----
---
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]