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

SqlCastException when comparing char with varchar

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 4.0.0, Impala 3.3.0
    • Impala 4.3.0
    • Frontend
    • ghx-label-10

    Description

      [localhost:21000] default> select 'expected 2',count(*) from ax where cast(t as string) = cast('a         ' as varchar(10));
      +--------------+----------+
      | 'expected 2' | count(*) |
      +--------------+----------+
      | expected 2   | 2        |
      +--------------+----------+
      Fetched 1 row(s) in 0.44s
      [localhost:21000] default> create table chartbl (c char(10));
      +-------------------------+
      | summary                 |
      +-------------------------+
      | Table has been created. |
      +-------------------------+
      Fetched 1 row(s) in 0.23s
      [localhost:21000] default> select * from chartbl where c = cast('test' as varchar(10));
      ERROR: SqlCastException: targetType=VARCHAR(*) type=VARCHAR(10)
      

      Also using the functional dataset:

      [localhost:21000] functional> select * from chars_tiny where cs = vc;
      ERROR: SqlCastException: targetType=VARCHAR(*) type=VARCHAR(5)
      

      Attachments

        Issue Links

          Activity

            People

              MikaelSmith Michael Smith
              tarmstrong Tim Armstrong
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: