Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
When we create catalog functions with hiveShell during tests, the functions get registered with FunctionRegistry. If later on we try to list Hive built-in functions, FunctionRegistry::getFunctionInfo will try to register the catalog functions with a session registry. And therefore fails if we don't have a SessionState in the test. The following example exposes this issue.
@Test public void test() throws Exception { hiveShell.execute("create function hiveudtf as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode'"); HiveModule hiveModule = new HiveModule(hiveCatalog.getHiveVersion()); hiveModule.listFunctions(); }
Fails with:
Caused by: java.lang.RuntimeException: Function registery for session is not initialized at org.apache.hadoop.hive.ql.session.SessionState.getRegistryForWrite(SessionState.java:979) at org.apache.hadoop.hive.ql.exec.Registry.registerToSessionRegistry(Registry.java:657) at org.apache.hadoop.hive.ql.exec.Registry.getQualifiedFunctionInfoUnderLock(Registry.java:616) at org.apache.hadoop.hive.ql.exec.Registry.getFunctionInfo(Registry.java:321) at org.apache.hadoop.hive.ql.exec.FunctionRegistry.getFunctionInfo(FunctionRegistry.java:549) at org.apache.flink.table.catalog.hive.client.HiveShimV120.getFunctionInfo(HiveShimV120.java:162) at org.apache.flink.table.catalog.hive.client.HiveShimV120.lambda$listBuiltInFunctions$0(HiveShimV120.java:142)
Attachments
Issue Links
- links to