jogrogan commented on code in PR #4891:
URL: https://github.com/apache/calcite/pull/4891#discussion_r3102707219
##########
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java:
##########
@@ -543,9 +545,7 @@ public Enumerable<MetaColumn> columns(final MetaTable
table_) {
String catalog,
Pat schemaPattern,
Pat functionNamePattern) {
- final Predicate1<MetaSchema> schemaMatcher = namedMatcher(schemaPattern);
- return createResultSet(schemas(catalog)
- .where(schemaMatcher)
+ return createResultSet(schemas(catalog, new LikePattern(schemaPattern.s))
Review Comment:
Both LikePattern.matcher (used by nameMatcher) and getNames are case
sensitive. Here's snippets from code:
LikePattern.matcher internals:
```
/**
* Converts a LIKE-style pattern (where '%' represents a wild-card, escaped
* using '\') to a Java regex. It's always case sensitive.
*/
public static Pattern likeToRegex(String pattern)...
```
Lookup getNames
```
/**
* Returns the names of the entities in matching pattern.
* The search is always case sensitive. This is caused by the fact that
* {@code DatabaseMetaData.getTables(...)} doesn't support case insensitive
* lookups.
*
* @return The names of all entities matching the pattern.
*/
Set<String> getNames(LikePattern pattern) ...
```
Lookup can have case insensitive gets but we aren't using those here. In
`schemas` when we do need to fetch the actual underlying schema found
`root.getSubSchema(name, true)` the `true` is `boolean caseSensitive` which
matches the predicate name check used previously.
This change is effectively a 1:1 copy of the tables() lookups in this class
--
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]