dongjoon-hyun commented on a change in pull request #25917: [SPARK-29225][SQL] 
Change Spark SQL `DESC FORMATTED` format same with Hive
URL: https://github.com/apache/spark/pull/25917#discussion_r331765353
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
 ##########
 @@ -565,8 +569,17 @@ case class DescribeTableCommand(
     result
   }
 
+  private def schemaWithoutPartCols(schema: StructType, partColNames: 
Seq[String]): StructType = {
+    if (partColNames.isEmpty) {
+      schema
+    } else {
+      StructType(schema.filter(col => !partColNames.contains(col.name)))
 
 Review comment:
   Although this function is used for the data from `metadata` only for now, 
this is a usual suspect for the case-sensitive failures.
   
   We don't know who will use this function later. And, since `partColNames` is 
`Seq[String]`, it's not safe. We had better consider a case-sensitivity. Please 
refer `SchemaUtils.normalizePartitionSpec` and 
`SchemaUtils.checkColumnNameDuplication`. You can use `resolver` to be robust.

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

Reply via email to