peter-toth commented on code in PR #36027:
URL: https://github.com/apache/spark/pull/36027#discussion_r975541056


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala:
##########
@@ -1026,7 +1026,14 @@ private[hive] object HiveClientImpl extends Logging {
     } else {
       
CharVarcharUtils.getRawTypeString(c.metadata).getOrElse(c.dataType.catalogString)
     }
-    new FieldSchema(c.name, typeString, c.getComment().orNull)
+    val name = if (lowerCase) {
+      // scalastyle:off caselocale
+      c.name.toLowerCase
+      // scalastyle:on caselocale
+    } else {
+      c.name

Review Comment:
   I'm not sure we can add a method that uses `HiveTable` (`import 
org.apache.hadoop.hive.ql.metadata.{Table => HiveTable}`) to `HiveClient` as it 
contradicts to the purpose of `HiveClient`: 
https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala#L29-L33
   
   If you feel the original commit 
(https://github.com/apache/spark/commit/f68ac14d1ff53c6b3104da5fb952495a97d5a4d1)
 is hacky then we can still fix the issue by passing fully restored catalog 
table to `HiveClient.getPartitionsByFilter()` in `HiveExternalCatalog 
.listPartitionsByFilter()`. But there might be other cases when need to do the 
fix, like `HiveExternalCatalog.renameTable()` seems to suffer from the same 
issue.



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