spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marmbrus <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6408] [SQL] Fix JDBCRDD filtering strin...
Date Sat, 21 Mar 2015 04:24:06 GMT
Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5087#discussion_r26888984
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala ---
    @@ -230,13 +231,19 @@ private[sql] class JDBCRDD(
        * Turns a single Filter into a String representing a SQL expression.
        * Returns null for an unhandled filter.
        */
    -  private def compileFilter(f: Filter): String = f match {
    -    case EqualTo(attr, value) => s"$attr = $value"
    -    case LessThan(attr, value) => s"$attr < $value"
    -    case GreaterThan(attr, value) => s"$attr > $value"
    -    case LessThanOrEqual(attr, value) => s"$attr <= $value"
    -    case GreaterThanOrEqual(attr, value) => s"$attr >= $value"
    -    case _ => null
    +  private def compileFilter(f: Filter): String = {
    +    def compileValue(value: Any): Any = value match {
    --- End diff --
    
    I would avoid nested functions unless they actually need to be nested (i.e. they are using
something that is only available in the scope of the function).


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message