gpt4 book ai didi

sql - 带有 2 个参数的 RTRIM

转载 作者:可可西里 更新时间:2023-11-01 15:21:01 25 4
gpt4 key购买 nike

你好,

你能给我建议吗,我该如何更换

RTRIM(path,'?')

使用 regexp_replace 或其他函数,可以在 hive 中使用?

非常感谢。

最佳答案

尝试使用 regexp_extract 功能。

示例:

我正在尝试使用 regexp_extract 函数提取字符串中除最后一个 ? 之外的所有字符。

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

关于sql - 带有 2 个参数的 RTRIM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53204648/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com