[
https://issues.apache.org/jira/browse/HIVE-29443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis resolved HIVE-29443.
----------------------------------------
Fix Version/s: 4.3.0
Resolution: Fixed
Fixed in
https://github.com/apache/hive/commit/a732ae0f071b0e9a3e9e030db8fc0acb441c6f68
> NPE in FunctionRegistry#getFunctionInfo when session not available
> ------------------------------------------------------------------
>
> Key: HIVE-29443
> URL: https://issues.apache.org/jira/browse/HIVE-29443
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2
> Reporter: Stamatis Zampetakis
> Assignee: Stamatis Zampetakis
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.3.0
>
>
> Various methods in FunctionRegistry fail with a NullPointerException when a
> session is not available and they attempt to perform a qualified lookup using
> the name of the current database.
> {noformat}
> java.lang.NullPointerException: Cannot invoke
> "org.apache.hadoop.hive.ql.session.SessionState.getCurrentDatabase()" because
> the return value of "org.apache.hadoop.hive.ql.session.SessionState.get()" is
> null
> at
> org.apache.hadoop.hive.ql.exec.Registry.getFunctionInfo(Registry.java:371)
> at
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.getFunctionInfo(FunctionRegistry.java:826)
> {noformat}
> Instead of failing with a NPE it is better to perform the lookup in the
> "default" database and return null if no function is found. This also reduces
> the coupling of the FunctionRegistry with the Session allowing to be used in
> other use-cases as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)