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

Adam Holley commented on IMPALA-7027:
-------------------------------------

When AggregateInfo removes duplicates of groupingExprs during the second pass 
of rewrites, the CastExprs becomes StringLiterals.  Because the localEquals 
checks only compares value, which in this case is "" for both, the second cast 
expr is removed.  This should be fine because we can cast from a smaller 
varchar to a larger, however castResultExprs() tries to recast because 
varchar(100) and varchar(101) are not strictly equal.

> Multiple Cast to Varchar with different limit fails with "AnalysisException: 
> null CAUSED BY: IllegalArgumentException: "
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-7027
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7027
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.0, Impala 2.12.0
>            Reporter: Meenakshi
>            Assignee: Adam Holley
>            Priority: Critical
>              Labels: planner, regression
>
> If we have multiple cast of '' to varchar statements in a impala query which 
> has a distinct like below, the query breaks for scenario when the cast to 
> varchar limit in the SQL is lower than the previous cast.
>  
> Query 1> Fails with " AnalysisException: null CAUSED BY: 
> IllegalArgumentException: targetType=VARCHAR(100) type=VARCHAR(101)"
> SELECT DISTINCT CAST('' as VARCHAR(101)) as CL_COMMENTS,CAST('' as 
> VARCHAR(100))  as CL_USER_ID FROM tablename limit 1
> Where as the below query succeeds
> Query 2> Success
>  SELECT DISTINCT CAST('' as VARCHAR(100)) as CL_COMMENTS,CAST('' as 
> VARCHAR(101))  as CL_USER_ID FROM  tablename limit 1
> *Workaround*
> SET ENABLE_EXPR_REWRITES=false;



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to