zoudan commented on code in PR #3128:
URL: https://github.com/apache/calcite/pull/3128#discussion_r1147048639
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibrary.java:
##########
@@ -94,11 +97,21 @@ public enum SqlLibrary {
/** Parses a comma-separated string such as "standard,oracle". */
public static List<SqlLibrary> parse(String libraryNameList) {
final ImmutableList.Builder<SqlLibrary> list = ImmutableList.builder();
- for (String libraryName : libraryNameList.split(",")) {
- SqlLibrary library =
- requireNonNull(SqlLibrary.of(libraryName),
- () -> "library does not exist: " + libraryName);
- list.add(library);
+ List<String> libList = Arrays.asList(libraryNameList.split(","));
+ if (libList.contains(ALL.abbrev) || libList.contains(ALL.fun)) {
+ // Add all the libraries except ALL, STANDARD, SPATIAL for 'all' and '*'.
+ for (SqlLibrary value : values()) {
+ if (value != ALL && value != STANDARD && value != SPATIAL) {
+ list.add(value);
+ }
+ }
+ } else {
+ for (String libraryName : libraryNameList.split(",")) {
Review Comment:
nice catch
--
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]