dongjoon-hyun commented on a change in pull request #26892: [SPARK-30262][SQL]
Fix NumberFormatException when totalSize is empty
URL: https://github.com/apache/spark/pull/26892#discussion_r357950741
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -1039,9 +1039,10 @@ private[hive] object HiveClientImpl {
* Note that this statistics could be overridden by Spark's statistics if
that's available.
*/
private def readHiveStats(properties: Map[String, String]):
Option[CatalogStatistics] = {
- val totalSize = properties.get(StatsSetupConst.TOTAL_SIZE).map(BigInt(_))
- val rawDataSize =
properties.get(StatsSetupConst.RAW_DATA_SIZE).map(BigInt(_))
- val rowCount = properties.get(StatsSetupConst.ROW_COUNT).map(BigInt(_))
+ val totalSize =
properties.get(StatsSetupConst.TOTAL_SIZE).filter(_.nonEmpty).map(BigInt(_))
+ val rawDataSize =
properties.get(StatsSetupConst.RAW_DATA_SIZE).filter(_.nonEmpty)
+ .map(BigInt(_))
+ val rowCount =
properties.get(StatsSetupConst.ROW_COUNT).filter(_.nonEmpty).map(BigInt(_))
Review comment:
This is a logical patch, but there is no evidence when this happens.
Could you give me a reproducible procedure which you met?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]