coral icon indicating copy to clipboard operation
coral copied to clipboard

Coral transform hive function “regexp_extract” to trino by introduce a new function "hive_pattern_to_trino"

Open gjhkael opened this issue 2 years ago • 1 comments

Coral transform the following hive sql to trino

select regexp_extract('1a 2b 14m', '\d+', 1); 

result:

select regexp_extract('1a 2b 14m', "hive_pattern_to_presto"('\d+'), 1); 

But trino not have the function name of "hive_pattern_to_presto", then the query will failed with exception:

Function 'hive_pattern_to_trino' not registered

So, why you introduce the "hive_pattern_to_trino" function? Do this function is implement in linkedin internal?

gjhkael avatar May 09 '22 07:05 gjhkael

Related code: https://github.com/linkedin/coral/blob/c96456329efc5eab15393e5c7bfb7e4e009f2245/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/UDFTransformer.java#L147-L149

findinpath avatar May 09 '22 08:05 findinpath