HIVE 中 split_function() 的等价物

Equivalent of split_function() in HIVE

根据我的项目要求,我想出了一个复杂的逻辑,其中 'a small section' 如下:

    'regexp_extract(split_part(vw_cart.order_detail,':',2), '[0-9]+', 0)'

它在 IMPALA 中很有效,但在 HIVE 中失败了。

我正在努力寻找类似于 'SPLIT_PART' 的东西来执行我的代码。

任何指导都会有所帮助。

在 Hive split() 函数中 returns 数组和数组元素从 0 开始编号。

In Impala split_part(vw_cart.order_detail,':',2) - returns 分隔字符串中的第二个元素,从 1

开始编号

因此,在 Hive 中它将是:

regexp_extract(split(vw_cart.order_detail,':')[1], '[0-9]+', 0)