Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5699

Posix regex expressions failed while NOT operator is executed with null literals.

    XMLWordPrintableJSON

Details

    Description

      Operations like :

      SELECT null !~ 'ab[cd]'
      SELECT 'abcd' !~ null
      SELECT null !~ null
      SELECT null !~* 'ab[cd]'
      SELECT 'abcd' !~* null
      SELECT null !~* null

      is not possible for now, NPE is raised :

      Caused by: java.lang.NullPointerException
           at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
           at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
           at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
           at java.base/java.util.regex.Pattern.matcher(Pattern.java:1134)
           at org.apache.calcite.runtime.SqlFunctions.posixRegex(SqlFunctions.java:864)

      Attachments

        Issue Links

          Activity

            People

              zstan Evgeny Stanilovsky
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: