winifredtang created CALCITE-2360:
-------------------------------------

             Summary: Why doesn't Like.sqlToRegexSimilar(String sqlPattern,char 
escapeChar) translate "." into "\\."?
                 Key: CALCITE-2360
                 URL: https://issues.apache.org/jira/browse/CALCITE-2360
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.16.0
            Reporter: winifredtang
            Assignee: Julian Hyde


org.apache.calcite.runtime.SqlFunctions.similar function call 
Like.sqlToRegexSimilar(String sqlPattern,char escapeChar) to translate SQL 
SIMILAR pattern to Java regex pattern. "." in SQL SIMILAR pattern is not a 
metacharacter, but when Like.sqlToRegexSimilar translates it to Java regex 
pattern, it becomes a metacharacter. 
For example, in SQL SIMILAR pattern, only string "ab." can match the pattern 
"ab.", but the result of org.apache.calcite.runtime.SqlFunctions.similar("ab1", 
"ab.") can also ruturn ture.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to