Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Table SQL / API
    • None

    Description

      Here's a naive implementation:

      public class RegexpMatchFunction extends ScalarFunction {
          // NOTE! Flink calls eval() by reflection
          public boolean eval(String value, String pattern) {
              return value != null && pattern != null && value.matches(pattern);
          }
      }
      

      I wonder if there would be a way to optimize this to use Pattern.compile(value) and use the compiled Pattern for multiple calls (possibly different values, but same pattern).

      Naming

      Should regex functions be prefixed with regexp_ or regex_? See also: https://github.com/apache/flink/pull/6448#issuecomment-415972833

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              juho.autio.r Juho Autio
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: