spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-2395][SQL] Optimize common LIKE pattern...
Date Tue, 08 Jul 2014 07:26:33 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1325#discussion_r14639677
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
    @@ -112,6 +113,26 @@ object ColumnPruning extends Rule[LogicalPlan] {
     }
     
     /**
    + * Simplifies LIKE expressions that do not need full regular expressions to evaluate
the condition.
    + * For example, when the expression is just checking to see if a string starts with a
given
    + * pattern.
    + */
    +object LikeSimplification extends Rule[LogicalPlan] {
    +  val startsWith = "([^_%]+)%".r
    --- End diff --
    
    This actually pretty tricky because you can add escape characters to %....


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message