Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Table SQL / API
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                juho.autio.r Juho Autio
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: