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/12/24 23:54:06 UTC

[GitHub] [spark] maropu commented on a change in pull request #26927: [SPARK-29505][SQL] Make DESC EXTENDED case insensitive
maropu commented on a change in pull request #26927: [SPARK-29505][SQL] Make DESC EXTENDED <table name> <column name> case insensitive
URL: https://github.com/apache/spark/pull/26927#discussion_r361233181
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
 ##########
 @@ -720,8 +721,14 @@ case class DescribeColumnCommand(
     }
 
     val catalogTable = catalog.getTempViewOrPermanentTableMetadata(table)
-    val colStats = catalogTable.stats.map(_.colStats).getOrElse(Map.empty)
-    val cs = colStats.get(field.name)
+    val colStats = if (conf.caseSensitiveAnalysis) {
+      catalogTable.stats.map(_.colStats).getOrElse(Map.empty)
+    } else {
+      catalogTable.stats.map(_.colStats.map {
+        case (key, value) => key.toLowerCase(Locale.ROOT) -> value
+      }).getOrElse(Map.empty)
+    }
+    val cs = colStats.get(getColumnName(field.name))
 
 Review comment:
   Ur, I totally forgot `CaseInsensitiveMap`... nice suggestion.

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