spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng Hao (JIRA)" <>
Subject [jira] [Resolved] (SPARK-5117) Hive Generic UDFs don't cast correctly
Date Wed, 07 Jan 2015 06:51:34 GMT


Cheng Hao resolved SPARK-5117.
    Resolution: Won't Fix

This IS NOT a bug of Spark SQL.

Hive changed the LPAD implementation since Hive 0.13, previously(Hive 0.12) the LPAD was implemented
as the UDF, and the UDF Bridge will cast the un-match argument type when necessary. However,
in Hive 0.13, LPAD was re-implemented as Generic UDF, which means the function itself has
to take care of the arguments type, and will throws exception if un-matched argument type

I've also test that in Hive 0.13, it says:
hive> SELECT LPAD("test",5, 0) FROM src LIMIT 1;                                      
FAILED: ClassCastException cannot be cast to

>From the document of Hive:
lpad(string str, int len, string pad)
The third parameter should be String-based type, the end-user should take care of the new
usage for this function.

> Hive Generic UDFs don't cast correctly
> --------------------------------------
>                 Key: SPARK-5117
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.2.0
>            Reporter: Michael Armbrust
>            Assignee: Cheng Hao
>            Priority: Blocker
> Here's a test cast that is failing in master:
> {code}
>   createQueryTest("generic udf casting",
>     """SELECT LPAD("test",5, 0) FROM src LIMIT 1""")
> {code}
> This appears to be a regression from Spark 1.1

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message