mihailom-db commented on code in PR #47364:
URL: https://github.com/apache/spark/pull/47364#discussion_r1746562282
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -341,7 +373,38 @@ private static int collationNameToId(String collationName)
throws SparkException
}
}
+ /**
+ * The catalog to which the `CollationSpec` belongs
+ */
+ protected abstract String catalog();
+
+ /**
+ * The schema to which the `CollationSpec` belongs
+ */
+ protected abstract String schema();
+
protected abstract Collation buildCollation();
+
+ static List<Collation> listCollations(String catalog, String schema,
String pattern) {
+ return Stream.concat(
+ CollationSpecUTF8.listCollations(catalog, schema, pattern).stream(),
+ CollationSpecICU.listCollations(catalog, schema,
pattern).stream()).toList();
+ }
+
+ static List<String> filterPattern(List<String> names, String pattern) {
Review Comment:
Could we just extract collation names? As in example with functions, we
treat built-in functions separately by just listing their names from
FunctionRegistry. It was expensive to list all Collation objects as they
contain Collators which are externally used objects. For the other part, if we
move the filtering process to `SessionCatalog`, similar to functions we should
be good with the package problem.
--
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]