cloud-fan commented on a change in pull request #26850: [SPARK-30215][SQL] 
Remove PrunedInMemoryFileIndex and merge its functionality into 
InMemoryFileIndex
URL: https://github.com/apache/spark/pull/26850#discussion_r363620212
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala
 ##########
 @@ -68,8 +70,11 @@ class InMemoryFileIndex(
   refresh0()
 
   override def partitionSpec(): PartitionSpec = {
+    if (userSpecifiedPartitionSpec.isDefined) {
+      cachedPartitionSpec = userSpecifiedPartitionSpec.get
+    }
     if (cachedPartitionSpec == null) {
-      cachedPartitionSpec = inferPartitioning()
+        cachedPartitionSpec = inferPartitioning()
 
 Review comment:
   why not put the `if (userSpecifiedPartitionSpec.isDefined)` inside this if?

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


With regards,
Apache Git Services

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

Reply via email to