[
https://issues.apache.org/jira/browse/IMPALA-1333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16784822#comment-16784822
]
Tim Armstrong commented on IMPALA-1333:
---------------------------------------
[~sndpsuman7] I don't think we necessarily want to change the behaviour
generally, being too liberal with implicit casts can cause trouble. If you have
a specific use case (i.e. sequence of queries) that doesn't work that can be
helpful in understanding whether a more targeted solution is possible.
> Missing implicit casts between char/varchar/string.
> ---------------------------------------------------
>
> Key: IMPALA-1333
> URL: https://issues.apache.org/jira/browse/IMPALA-1333
> Project: IMPALA
> Issue Type: Improvement
> Components: Frontend
> Affects Versions: Impala 2.0, Impala 2.2, Impala 2.3.0
> Reporter: Lenni Kuff
> Priority: Minor
> Labels: sql-language, usability
>
> The following scenario needs to work:
> {code}
> create table vc (v varchar(10));
> insert into vc select 'a';
> ERROR: AnalysisException: Possible loss of precision for target table
> 'default.vc'.
> Expression ''a'' (type: STRING) would need to be cast to VARCHAR(10) for
> column 'v'
> {code}
> *Workaround*
> Use explicit casts.
> {code}
> Query: insert into vc select cast('a' as varchar(10))
> Inserted 1 row(s) in 0.32s
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]