You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jason Dere (JIRA)" <ji...@apache.org> on 2015/09/09 23:01:45 UTC
[jira] [Commented] (HIVE-11739) int to string implicit conversion
problem
[ https://issues.apache.org/jira/browse/HIVE-11739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737579#comment-14737579 ]
Jason Dere commented on HIVE-11739:
-----------------------------------
So implicit type conversion does not actually occur in the parameters GenericUDFs - it is up to the GenericUDF's implementation to take care of which types it will accept within initialize(). It is a bit different from the old-style UDFs, which Hive will do type conversion to find the best version of evaluate() to use.
> int to string implicit conversion problem
> -----------------------------------------
>
> Key: HIVE-11739
> URL: https://issues.apache.org/jira/browse/HIVE-11739
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Affects Versions: 1.0.0
> Reporter: Nezih Yigitbasi
>
> Below query works on Hive 0.11 while it fails on Hive 1.0. According to the wiki (https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-StringTypes) int should be implicitly converted to string, but somehow it is not converted in this case by Hive 1.0 and it fails with {{FAILED: SemanticException \[Error 10014\]: Line 1:21 Wrong arguments ''yyyyMMdd'': The function UNIX_TIMESTAMP takes only string/date/timestamp types}}
> Here is the the query:
> {code}
> drop table t;
> create table t (x string) partitioned by (date_column int);
> INSERT INTO TABLE t partition(date_column=20150903) SELECT 'a' from default.dual;
> select * from t;
> select from_unixtime(unix_timestamp(date_column ,'yyyyMMdd'), 'yyyy-MM-dd') AS date_column,
> max_date_column
> from t
> left outer join(
> SELECT
> MAX(date_column) AS max_date_column
> FROM t
> WHERE date_column > 1
> ) U
> ON t.date_column = U.max_date_column
> where date_column > 1;
> drop table t;
> {code}
> Any ideas [~jdere]?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)