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

zoucao commented on FLINK-26355:
--------------------------------

Hi, [~luoyuxia], I found this problem in the process of driving the type 
exception about json_tuple, the same problem proposed in FLINK-25727 we faced. 
To skip this type not match exception, I change the SQL from 
{code:java} json_tuple(tb.json, 'f1', 'f2') {code}
 to  
{code:java} json_tuple(tb.json, cast('f1' as string), cast('f2' as sting))  
{code}
After rewriting the SQL, I got the 'not support VarcharType' exception from 
`HiveTableSqlFunction#coerce`, I wish it can help you.
By the way, I found the [pr|https://github.com/apache/flink/pull/18548] 
proposed in FLINK-25727 is not work in my environment,  the method 
`setArgumentTypesAndConstants` was not invoked. IIUC, 
`HiveGenericUDTF#setArgumentTypesAndConstants` was only invoked by 
`HiveGenericUDAF`, should we rewrite `getHiveResultType` to fix it ?
Feel free to let me know what I can help to do about it.

> VarCharType was not be considered in HiveTableSqlFunction
> ---------------------------------------------------------
>
>                 Key: FLINK-26355
>                 URL: https://issues.apache.org/jira/browse/FLINK-26355
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Ecosystem
>            Reporter: zoucao
>            Priority: Major
>
> VarCharType was not be considered in `HiveTableSqlFunction#coerce`, see 
> [link|https://github.com/apache/flink/blob/a7192af8707f3f0d0f30fc71f3477edd92135cac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/utils/HiveTableSqlFunction.java#L146],
>  before invoke `HiveTableSqlFunction#coerce`, flink will call the method 
> `createFieldTypeFromLogicalType` to build argumentsArray, if the field's type 
> is varchar, the exception will be thrown.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to