You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/27 01:56:47 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #25584: [SPARK-28876][SQL] fallBackToHdfs should not support Hive partitioned table

cloud-fan commented on a change in pull request #25584: [SPARK-28876][SQL] fallBackToHdfs should not support Hive partitioned table
URL: https://github.com/apache/spark/pull/25584#discussion_r317864694
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala
 ##########
 @@ -114,22 +114,22 @@ class ResolveHiveSerdeTable(session: SparkSession) extends Rule[LogicalPlan] {
 
 class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
-    case relation: HiveTableRelation
-        if DDLUtils.isHiveTable(relation.tableMeta) && relation.tableMeta.stats.isEmpty =>
-      val table = relation.tableMeta
-      val sizeInBytes = if (session.sessionState.conf.fallBackToHdfsForStatsEnabled) {
+    case relation @ HiveTableRelation(table, _, partitionCols)
+      if DDLUtils.isHiveTable(table) && table.stats.isEmpty =>
+      val conf = session.sessionState.conf
+      val sizeInBytes = if (conf.fallBackToHdfsForStatsEnabled && partitionCols.isEmpty) {
 
 Review comment:
   can we add some comment to explain why we should skip partitioned tables?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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