GitHub user davies opened a pull request:
https://github.com/apache/spark/pull/11501
[SPARK-13657] [SQL] parser very long AND/OR expressions
## What changes were proposed in this pull request?
In order to avoid StackOverflow when parse a expression with hundreds of
ORs, we should use loop instead of recursive functions to flatten the tree as
list. This PR also build a balanced tree to reduce the depth of generated
And/Or expression, to avoid StackOverflow in analyzer/optimizer.
## How was this patch tested?
Add new unit tests. Manually tested with TPCDS Q3 with hundreds predicates
in it [1]. These helps to reduce the number of partitions, then go query time
went from 60 seconds to 8 seconds.
[1] https://github.com/cloudera/impala-tpcds-kit/blob/master/queries/q3.sql
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/davies/spark long_or
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11501.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 #11501
----
----
---
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]