You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2022/07/30 14:10:00 UTC
[jira] [Closed] (FLINK-25142) The user-defined hive udtf initialize exception in hive dialect
[ https://issues.apache.org/jira/browse/FLINK-25142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jark Wu closed FLINK-25142.
---------------------------
Fix Version/s: 1.16.0
Assignee: xiangqiao
Resolution: Fixed
Fixed in master: 541c66b7b71b39619cb1ba4b07ba4326571c9fb5 and 99bd440ec64c47cd7fb105c1e18c3dac29569ab7
> The user-defined hive udtf initialize exception in hive dialect
> ---------------------------------------------------------------
>
> Key: FLINK-25142
> URL: https://issues.apache.org/jira/browse/FLINK-25142
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / Hive
> Affects Versions: 1.13.0, 1.14.0
> Reporter: xiangqiao
> Assignee: xiangqiao
> Priority: Minor
> Labels: auto-deprioritized-major, pull-request-available
> Fix For: 1.16.0
>
> Attachments: image-2021-12-02-16-14-31-441.png
>
>
> I met the problem and added a unit test in HiveDialectITCase to reproduce this question:
> This is the compatibility of hive udtf. Refer to this issue:https://issues.apache.org/jira/browse/HIVE-5737
> {code:java}
> @Test
> public void testTemporaryFunctionUDTFInitializeWithStructObjectInspector() throws Exception {
> // create temp function
> tableEnv.executeSql(
> String.format(
> "create temporary function temp_split as '%s'",
> HiveGenericUDTFTest.TestSplitUDTFInitializeWithStructObjectInspector.class
> .getName()));
> String[] functions = tableEnv.listUserDefinedFunctions();
> assertArrayEquals(new String[] {"temp_split"}, functions);
> // call the function
> tableEnv.executeSql("create table src(x string)");
> tableEnv.executeSql("insert into src values ('a,b,c')").await();
> assertEquals(
> "[+I[a], +I[b], +I[c]]",
> queryResult(tableEnv.sqlQuery("select temp_split(x) from src")).toString());
> // switch DB and the temp function can still be used
> tableEnv.executeSql("create database db1");
> tableEnv.useDatabase("db1");
> assertEquals(
> "[+I[a], +I[b], +I[c]]",
> queryResult(tableEnv.sqlQuery("select temp_split(x) from `default`.src"))
> .toString());
> // drop the function
> tableEnv.executeSql("drop temporary function temp_split");
> functions = tableEnv.listUserDefinedFunctions();
> assertEquals(0, functions.length);
> tableEnv.executeSql("drop temporary function if exists foo");
> } {code}
>
> !image-2021-12-02-16-14-31-441.png|width=1356,height=352!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)