You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Juho Autio (JIRA)" <ji...@apache.org> on 2018/08/25 14:23:00 UTC

[jira] [Created] (FLINK-10216) Add REGEXP_MATCH in TableAPI and SQL

Juho Autio created FLINK-10216:
----------------------------------

             Summary: Add REGEXP_MATCH in TableAPI and SQL
                 Key: FLINK-10216
                 URL: https://issues.apache.org/jira/browse/FLINK-10216
             Project: Flink
          Issue Type: Sub-task
            Reporter: Juho Autio


Here's a naive implementation:

{code:java}
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);
    }
}
{code}

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).



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