Github user mallman commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14690#discussion_r82850487
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala 
---
    @@ -225,13 +225,16 @@ case class FileSourceScanExec(
       }
     
       // These metadata values make scan plans uniquely identifiable for 
equality checking.
    -  override val metadata: Map[String, String] = Map(
    -    "Format" -> relation.fileFormat.toString,
    -    "ReadSchema" -> outputSchema.catalogString,
    -    "Batched" -> supportsBatch.toString,
    -    "PartitionFilters" -> partitionFilters.mkString("[", ", ", "]"),
    -    "PushedFilters" -> dataFilters.mkString("[", ", ", "]"),
    -    "InputPaths" -> relation.location.paths.mkString(", "))
    +  override val metadata: Map[String, String] = {
    +    def seqToString(seq: Seq[Any]) = seq.mkString("[", ", ", "]")
    +    val location = relation.location
    +    Map("Format" -> relation.fileFormat.toString,
    +      "ReadSchema" -> outputSchema.catalogString,
    +      "Batched" -> supportsBatch.toString,
    +      "PartitionFilters" -> seqToString(partitionFilters),
    +      "PushedFilters" -> seqToString(dataFilters),
    +      "Location" -> (location.getClass.getSimpleName + 
seqToString(location.rootPaths)))
    --- End diff --
    
    I'm going to pull this value out to a local `val`. The reason I don't want 
to make this part of the `BasicFileCatalog` type is that this format seems 
specific to this class's `metadata` method. For example, we're using the 
method-local `seqToString` method to format the `rootPaths` list.
    
    Regarding the partition count, this is actually a little trickier than I 
expected. I'm going to expand on that in a standalone PR comment after the next 
push.


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

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

Reply via email to