Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gjhkael opened this issue May 9, 2022 · 1 comment

Comments

@gjhkael
Copy link

gjhkael commented May 9, 2022

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?

@findinpath
Copy link
Contributor

Related code:

OP_MAP.put("hive_pattern_to_trino",
new SqlUserDefinedFunction(new SqlIdentifier("hive_pattern_to_trino", SqlParserPos.ZERO),
FunctionReturnTypes.STRING, null, OperandTypes.STRING, null, null));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants