Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.11.0, 1.12.0, 1.13.0, 1.14.0
Description
When hive udaf/udtf is used, a validate exception is thrown ,i added a unit test in HiveDialectITCase to reproduce this question:
@Test public void testTemporaryFunctionUDAF() throws Exception { // create temp function tableEnv.executeSql( String.format( "create temporary function temp_count as '%s'", GenericUDAFCount.class.getName())); String[] functions = tableEnv.listUserDefinedFunctions(); assertArrayEquals(new String[] {"temp_count"}, functions); // call the function tableEnv.executeSql("create table src(x int)"); tableEnv.executeSql("insert into src values (1),(-1)").await(); assertEquals( "[+I[2]]", queryResult(tableEnv.sqlQuery("select temp_count(x) from src")).toString()); // switch DB and the temp function can still be used tableEnv.executeSql("create database db1"); tableEnv.useDatabase("db1"); assertEquals( "[+I[2]]", queryResult(tableEnv.sqlQuery("select temp_count(x) from `default`.src")) .toString()); // drop the function tableEnv.executeSql("drop temporary function temp_count"); functions = tableEnv.listUserDefinedFunctions(); assertEquals(0, functions.length); tableEnv.executeSql("drop temporary function if exists foo"); }
Attachments
Attachments
Issue Links
- is related to
-
FLINK-25142 The user-defined hive udtf initialize exception in hive dialect
- Closed
- links to