OpenMLDB
OpenMLDB copied to clipboard
SQL: support the SQL `RLIKE` expression
#841 's further work
Brief Description
regex expression match predicate. SQL syntax should be:
<string expr> [ NOT ] RLIKE <pattern>
Implementation strategy
Generally the implementation steps is the same as the like predicate in #841.
- Add grammar support in zetasql, the
RLIKE
keyword - Logic plan: Treat RLIKE as a binary expr and handle it in
hybridse/src/planv2
- Physical plan: handle RLIKE ExprNode
- Codege: support handle
RLIKE
expr type inhybridse/src/codegen/expr_ir_builder.{h,cc}
- require add the builtin udf function
REGEXP_LIKE
- require add the builtin udf function
Well tested
- each step above should have UT covered
- end-to-end test yaml test case should added to
cases/
, testingRLIKE
as well asREGEXP_LIKE()
REGEXP_LIKE
function
- should be compatible with the function in MySQL/SparkSQL
- two version, difference by params
-
REGEXP_LIKE( <subject> , <pattern>)
-
REGEXP_LIKE( <subject> , <pattern> [ , <parameters> ] )
-
have a look of external links:
- https://docs.snowflake.com/en/sql-reference/functions/rlike.html
- https://docs.snowflake.com/en/sql-reference/functions/regexp_like.html
- https://dev.mysql.com/doc/refman/8.0/en/regexp.html#function_regexp-like
- https://spark.apache.org/docs/latest/api/sql/index.html#regexp_like
Consider
- the regular expression standard going to adopted and pretty document & example for that
- it may not so complicated in the first version
Alternative Context
- it do not support
SIMILAR TO
predicate defined in ANSI SQL
Hi, I'd like to take on this task and plan to complete it within a month.