You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Rui Li (Jira)" <ji...@apache.org> on 2020/06/01 07:25:00 UTC

[jira] [Updated] (FLINK-18030) Hive UDF doesn't accept empty string literal parameter

     [ https://issues.apache.org/jira/browse/FLINK-18030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rui Li updated FLINK-18030:
---------------------------
    Fix Version/s:     (was: 1.12.0)
                   1.11.0

> Hive UDF doesn't accept empty string literal parameter
> ------------------------------------------------------
>
>                 Key: FLINK-18030
>                 URL: https://issues.apache.org/jira/browse/FLINK-18030
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Hive
>            Reporter: Rui Li
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>
> Empty string literal parameters are considered to be of type {{CHAR(0)}}, which is not supported in Hive. Therefore calling functions like {{REGEXP_REPLACE('abcd', 'a', '')}} would fail with exception:
> {noformat}
> Caused by: java.lang.RuntimeException: Char length 0 out of allowed range [1, 255]
> at org.apache.hadoop.hive.serde2.typeinfo.BaseCharUtils.validateCharParameter(BaseCharUtils.java:39)
> at org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo.(CharTypeInfo.java:33)
> at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.createPrimitiveTypeInfo(TypeInfoFactory.java:146)
> at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getPrimitiveTypeInfo(TypeInfoFactory.java:109)
> at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.getCharTypeInfo(TypeInfoFactory.java:165)
> at org.apache.flink.table.catalog.hive.util.HiveTypeUtil$TypeInfoLogicalTypeVisitor.visit(HiveTypeUtil.java:191)
> at org.apache.flink.table.catalog.hive.util.HiveTypeUtil$TypeInfoLogicalTypeVisitor.visit(HiveTypeUtil.java:173)
> at org.apache.flink.table.types.logical.CharType.accept(CharType.java:149)
> at org.apache.flink.table.catalog.hive.util.HiveTypeUtil.toHiveTypeInfo(HiveTypeUtil.java:84)
> at org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:127)
> ... 67 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)