You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Michael Armbrust (JIRA)" <ji...@apache.org> on 2015/06/17 22:01:05 UTC
[jira] [Resolved] (SPARK-8077) Optimisation of TreeNode for large
number of children
[ https://issues.apache.org/jira/browse/SPARK-8077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Armbrust resolved SPARK-8077.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.5.0
Issue resolved by pull request 6673
[https://github.com/apache/spark/pull/6673]
> Optimisation of TreeNode for large number of children
> -----------------------------------------------------
>
> Key: SPARK-8077
> URL: https://issues.apache.org/jira/browse/SPARK-8077
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 1.3.1
> Reporter: Mick Davies
> Priority: Minor
> Fix For: 1.5.0
>
>
> Large IN clauses are parsed very slowly. For example SQL below (10K items in IN) takes 45-50s.
> {code}
> s"""SELECT * FROM Person WHERE ForeName IN ('${(1 to 10000).map("n" + _).mkString("','")}')"""
> {code}
> This is principally due to TreeNode which repeatedly call contains on children, where children in this case is a List that is 10K long. In effect parsing for large IN clauses is O(N squared).
> A small change that uses a lazily initialised Set based on children for contains reduces parse time to around 2.5s
> I'd like to create PR for change, as we often use IN clauses with a few thousand items.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org