Validate and convert SQL 'like' pattern to a Java regular expression.
Validate and convert SQL 'like' pattern to a Java regular expression.
Underscores (_) are converted to '.' and percent signs (%) are converted to '.*', other characters are quoted literally. Escaping is done according to the rules specified in org.apache.spark.sql.catalyst.expressions.Like usage documentation. An invalid pattern will throw an AnalysisException.
the SQL pattern to convert
the equivalent Java regular expression of the pattern
This utility can be used for filtering pattern in the "Like" of "Show Tables / Functions" DDL
This utility can be used for filtering pattern in the "Like" of "Show Tables / Functions" DDL
the names list to be filtered
the filter pattern, only '*' and '|' are allowed as wildcards, others will follow regular expression convention, case insensitive match and white spaces on both ends will be ignored
the filtered names list in order