You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "luoyuxia (Jira)" <ji...@apache.org> on 2022/03/04 03:39:00 UTC
[jira] [Commented] (FLINK-26474) Fail to call hive udf when secondary parameter required constant but pass value like "-1"
[ https://issues.apache.org/jira/browse/FLINK-26474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501130#comment-17501130 ]
luoyuxia commented on FLINK-26474:
----------------------------------
I would like to fix it.
> Fail to call hive udf when secondary parameter required constant but pass value like "-1"
> ------------------------------------------------------------------------------------------
>
> Key: FLINK-26474
> URL: https://issues.apache.org/jira/browse/FLINK-26474
> Project: Flink
> Issue Type: Sub-task
> Components: Connectors / Hive
> Reporter: luoyuxia
> Priority: Major
> Fix For: 1.16.0
>
>
> The exception can be reproduced using following code in HiveDialectITCase
> {code:java}
> HiveModule hiveModule = new HiveModule(hiveCatalog.getHiveVersion());
> CoreModule coreModule = CoreModule.INSTANCE;
> for (String loaded : tableEnv.listModules()) {
> tableEnv.unloadModule(loaded);
> }
> tableEnv.loadModule("hive", hiveModule);
> tableEnv.loadModule("core", coreModule);
> List<Row> results = CollectionUtil.iteratorToList(tableEnv.executeSql("select bround(55.0, -1)").collect());
> {code}
> It will case such exception "BROUND second argument only takes constant", the reson is the parameter "-1" will be considered as function call instead of contant, we should reduce it just like what has done in HiveParserTypeCheckProcFactory#getXpathOrFuncExprNodeDesc to reduce "+".
--
This message was sent by Atlassian Jira
(v8.20.1#820001)