[ 
https://issues.apache.org/jira/browse/FLINK-30452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17649196#comment-17649196
 ] 

luoyuxia commented on FLINK-30452:
----------------------------------

I don't think when we do the type inference, void type should be considered as 
string type.

In the other code, we just consider void type as [null type 
|[https://github.com/apache/flink/blob/df0bc117341a4017a1aea0234cb1d63202562be3/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/HiveParserRexNodeConverter.java#L451]]

or [unsupported type 
|[https://github.com/apache/flink/blob/2e5cac1f31aa571276df20e24889994672692a89/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveTypeUtil.java#L154]]

> Wrong argument type is used when call Hive's function
> -----------------------------------------------------
>
>                 Key: FLINK-30452
>                 URL: https://issues.apache.org/jira/browse/FLINK-30452
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Connectors / Hive
>            Reporter: luoyuxia
>            Priority: Major
>
> While calling Hive function, if the argument is void type, it will be 
> [considered as string type|#L553]], which may bring wrong type inference and 
> thus may well cause other problems.
>  
> For example, 
> {code:java}
> timestamp(if(a = null, null, a)
> {code}
> the argument for function `if` is `null` and `a`, null is void type,  `a` is 
> bigint type, so the inferred return type should be bigint for the `if` 
> function will ignore void type and just consider the other argument type.  
> But we consider the void type as string type, the return type inferred will 
> be string according to the `if` function inference logic.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to