You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/17 06:16:30 UTC

[GitHub] [incubator-doris] xinghuayu007 commented on pull request #4347: udf: str_replace function

xinghuayu007 commented on pull request #4347:
URL: https://github.com/apache/incubator-doris/pull/4347#issuecomment-674681260


   > I tested the name `replace` and it works. So I suggest to rename the `str_replace` to `replace`.
   > 
   > You can just patch the following `diff` file to your code.
   > 
   > ```
   > diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup
   > index cd4ea3cdb..7b5e8d2d2 100644
   > --- a/fe/fe-core/src/main/cup/sql_parser.cup
   > +++ b/fe/fe-core/src/main/cup/sql_parser.cup
   > @@ -4592,6 +4592,8 @@ keyword ::=
   >      {: RESULT = id; :}
   >      | KW_REPEATABLE:id
   >      {: RESULT = id; :}
   > +    | KW_REPLACE:id
   > +    {: RESULT = id; :}
   >      | KW_REPLACE_IF_NOT_NULL:id
   >      {: RESULT = id; :}
   >      | KW_REPOSITORY:id
   > diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py
   > index c966b7d8f..ed26fae15 100755
   > --- a/gensrc/script/doris_builtins_functions.py
   > +++ b/gensrc/script/doris_builtins_functions.py
   > @@ -605,7 +605,7 @@ visible_functions = [
   >              '15FunctionContextENS2_18FunctionStateScopeE'],
   >      [['concat'], 'VARCHAR', ['VARCHAR', '...'],
   >              '_ZN5doris15StringFunctions6concatEPN9doris_udf15FunctionContextEiPKNS1_9StringValE'],
   > -    [['str_replace'], 'VARCHAR', ['VARCHAR', 'VARCHAR', 'VARCHAR'],
   > +    [['replace'], 'VARCHAR', ['VARCHAR', 'VARCHAR', 'VARCHAR'],
   >              '_ZN5doris15StringFunctions11str_replaceEPN9doris_udf15FunctionContextERKNS1_9StringValES6_S6_'],
   >      [['concat_ws'], 'VARCHAR', ['VARCHAR', 'VARCHAR', '...'],
   >              '_ZN5doris15StringFunctions9concat_wsEPN9doris_udf'
   > ```
   
   Thxs!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org