简体   繁体   中英

RTRIM with 2 arguments

Good day,

Can u give me advice, how can i replace

RTRIM(path,'?')

with using regexp_replace or another functions, which is possible to use in hive?

thanks a lot.

Try with regexp_extract function.

Example:

im trying to extract all characters of string except for last ? using regexp_extract fucntion.

hive> select regexp_extract(string("?hi?"),"(.*)\\?",1);
+------+--+
| _c0  |
+------+--+
| ?hi  |
+------+--+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM