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

HIVE-24997. HPL/SQL udf doesn't work in tez container mode (amagyar) #2166

Merged
merged 1 commit into from Apr 14, 2021

Conversation

zeroflag
Copy link
Contributor

HPLSQL supports stored function calls from HiveQL selects:

For example:

create function hello(s string) returns string;
begin
  return 'hello ' || s;
end;

The above stored function can be used in a select:

select hello(name) from employees;

HPLSQL translates this to a UDF call.

SELECT hplsql('hello(:1)', name) FROM users;

The hplsql UDF is going to call the hplsql interpreter to evaluate the hello function. The earlier implementation used to look up the interpreter from the session state. But this only works if the evaluation happens in compile time and the UDF is running inside the HS2 process. This is not true for general therefore the UDF should instantiate a new interpreter and use that to eval the function call.

@zeroflag
Copy link
Contributor Author

cc: @mustafaiman

@mustafaiman
Copy link
Contributor

👍

@kasakrisz kasakrisz merged commit 70ebffd into apache:master Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants