spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HyukjinKwon <...@git.apache.org>
Subject [GitHub] spark pull request #18160: [SPARK-20938][SQL] Keep/print the string represen...
Date Wed, 21 Jun 2017 07:38:58 GMT
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18160#discussion_r123173545
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
---
    @@ -370,18 +368,26 @@ case class DataSourceStrategy(conf: SQLConf) extends Strategy with
Logging with
         // These metadata values make scan plans uniquely identifiable for equality checking.
         // TODO(SPARK-17701) using strings for equality checking is brittle
         val metadata: Map[String, String] = {
    -      val pairs = ArrayBuffer.empty[(String, String)]
    -
    +      val schemaString = StructType.fromAttributes(projects.map(_.toAttribute)).catalogString
           // Mark filters which are handled by the underlying DataSource with an Astrisk
    -      if (pushedFilters.nonEmpty) {
    -        val markedFilters = for (filter <- pushedFilters) yield {
    +      relation match {
    +        case LogicalRelation(_: CatalystScan, _, _) if candidatePredicates.nonEmpty =>
    +          val markedPredicates = for (predicate <- candidatePredicates) yield {
    +            if (handledPredicates.contains(predicate)) s"*$predicate" else s"$predicate"
    +          }
    +          Map(
    +            "PushedCatalystFilters" -> markedPredicates.mkString("[", ", ", "]"),
    +            "ReadSchema" -> schemaString)
    +        case _ if pushedFilters.nonEmpty =>
    +          val markedFilters = for (filter <- pushedFilters) yield {
                 if (handledFilters.contains(filter)) s"*$filter" else s"$filter"
    -        }
    -        pairs += ("PushedFilters" -> markedFilters.mkString("[", ", ", "]"))
    +          }
    +          Map(
    +            "PushedFilters" -> markedFilters.mkString("[", ", ", "]"),
    +            "ReadSchema" -> schemaString)
    +        case _ =>
    +          Map("ReadSchema" -> schemaString)
           }
    -      pairs += ("ReadSchema" ->
    --- End diff --
    
    @gatorsmile, should I try to remove it here or is it fine as is for now?


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