taroplus commented on a change in pull request #33981:
URL: https://github.com/apache/spark/pull/33981#discussion_r707907989
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -3768,6 +3768,24 @@ class SQLConf extends Serializable with Logging {
}
}
+ /**
+ * Returns the [[Comparator]] for the current configuration,
+ * which can be used to compare two identifiers.
+ */
+ private[sql] def comparator: Comparator = {
+ if (caseSensitiveAnalysis) {
+ org.apache.spark.sql.catalyst.analysis.caseSensitiveComparator
+ } else {
+ org.apache.spark.sql.catalyst.analysis.caseInsensitiveComparator
+ }
+ }
+
+ private[sql] val fieldNameOrdering = new Ordering[String] {
Review comment:
not sure how much difference it makes, however checking config
(caseSensitiveAnalysis) for every evaluation doesn't look necessary, can we do
create an ordering per config ...
```
private[sql] def fieldNameOrdering: Ordering[String] = {
if (caseSensitiveAnalysis) {
(a: String, b: String) => a.compareTo(b)
} else {
(a: String, b: String) => a.compareToIgnoreCase(b)
}
}
```
--
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]