panbingkun commented on code in PR #45927:
URL: https://github.com/apache/spark/pull/45927#discussion_r1560342791


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala:
##########
@@ -104,21 +105,28 @@ private[hive] class HiveMetastoreCatalog(sparkSession: 
SparkSession) extends Log
               None
             }
           case _ =>
-            logWarning(s"Table $tableIdentifier should be stored as 
$expectedFileFormat. " +
-              s"However, we are getting a ${relation.fileFormat} from the 
metastore cache. " +
-              "This cached entry will be invalidated.")
+            logWarningUnexpectedFileFormat(tableIdentifier, expectedFileFormat,
+              relation.fileFormat.toString)
             catalogProxy.invalidateCachedTable(tableIdentifier)
             None
         }
       case other =>
-        logWarning(s"Table $tableIdentifier should be stored as 
$expectedFileFormat. " +
-          s"However, we are getting a $other from the metastore cache. " +
-          "This cached entry will be invalidated.")
+        logWarningUnexpectedFileFormat(tableIdentifier, expectedFileFormat, 
other.toString)
         catalogProxy.invalidateCachedTable(tableIdentifier)
         None
     }
   }
 
+  private def logWarningUnexpectedFileFormat(

Review Comment:
   Extract a `common` method 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to