Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15090#discussion_r80639243
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala ---
    @@ -473,15 +476,20 @@ private[spark] class HiveExternalCatalog(conf: 
SparkConf, hadoopConf: Configurat
           }
         }
         // construct Spark's statistics from information in Hive metastore
    -    if (catalogTable.properties.contains(STATISTICS_TOTAL_SIZE)) {
    -      val totalSize = 
BigInt(catalogTable.properties.get(STATISTICS_TOTAL_SIZE).get)
    -      // TODO: we will compute "estimatedSize" when we have column stats:
    -      // average size of row * number of rows
    +    if 
(catalogTable.properties.filterKeys(_.startsWith(STATISTICS_PREFIX)).nonEmpty) {
    +      val colStatsProps = catalogTable.properties
    +        .filterKeys(_.startsWith(STATISTICS_BASIC_COL_STATS_PREFIX))
    +        .map { case (k, v) => 
(k.replace(STATISTICS_BASIC_COL_STATS_PREFIX, ""), v) }
    --- End diff --
    
    I think it's safer to do `k.drop(STATISTICS_BASIC_COL_STATS_PREFIX.length)`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to