Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7027

Multiple Cast to Varchar with different limit fails with "AnalysisException: null CAUSED BY: IllegalArgumentException: "

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0, Impala 3.0, Impala 2.12.0
    • Impala 3.4.0
    • Frontend

    Description

      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;

      Attachments

        Issue Links

          Activity

            People

              ychena Yongzhi Chen
              msundaram Meenakshi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: