[
https://issues.apache.org/jira/browse/CALCITE-7906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ruben Q L updated CALCITE-7906:
-------------------------------
Description:
LikePattern (which handles the patterns passed to JDBC {{DatabaseMetaData}}
methods such as {{getTables}} and {{getColumns}} and to {{Lookup.getNames}})
has implements matching via {{likeToRegex}} which turns each % into .* and
matches with java.util.regex. For example:
{noformat}
%%%%%%%%%%x => .*.*.*.*.*.*.*.*.*.*x
%a%a%a%a%a%a%a%a%a%a%x => .*a.*a.*a.*a.*a.*a.*a.*a.*a.*a.*x
{noformat}
A pattern with many wildcards makes the regex engine backtrack heavily when the
name doesn't match.
Apart from that, it currently does not support '_' wildcard, as JDBC
specification requires.
was:
LikePattern.likeToRegex turns each % into .* and matches with java.util.regex.
For example:
{noformat}
%%%%%%%%%%x => .*.*.*.*.*.*.*.*.*.*x
%a%a%a%a%a%a%a%a%a%a%x => .*a.*a.*a.*a.*a.*a.*a.*a.*a.*a.*x
{noformat}
A pattern with many wildcards makes the regex engine backtrack heavily when the
name doesn't match.
> Improve LikePattern to support '_' wildcard and enhance the performance of
> '%' wildcards
> ----------------------------------------------------------------------------------------
>
> Key: CALCITE-7906
> URL: https://issues.apache.org/jira/browse/CALCITE-7906
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Ruben Q L
> Assignee: Ruben Q L
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> LikePattern (which handles the patterns passed to JDBC {{DatabaseMetaData}}
> methods such as {{getTables}} and {{getColumns}} and to {{Lookup.getNames}})
> has implements matching via {{likeToRegex}} which turns each % into .* and
> matches with java.util.regex. For example:
> {noformat}
> %%%%%%%%%%x => .*.*.*.*.*.*.*.*.*.*x
> %a%a%a%a%a%a%a%a%a%a%x => .*a.*a.*a.*a.*a.*a.*a.*a.*a.*a.*x
> {noformat}
> A pattern with many wildcards makes the regex engine backtrack heavily when
> the name doesn't match.
> Apart from that, it currently does not support '_' wildcard, as JDBC
> specification requires.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)