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

Incorrect length when multiple CHAR(N) values are inserted

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Frontend
    • Epic Color:
      ghx-label-11

      Description

      To reproduce:

      CREATE TABLE impala_char_insert (s STRING);
      
      -- all values are CHAR(N) with different N, but all will use the biggest N
      INSERT OVERWRITE impala_char_insert VALUES (CAST("1" AS CHAR(1))), (CAST("12" AS CHAR(2))), (CAST("123" AS CHAR(3)));
      SELECT length(s) FROM impala_char_insert;
      results:
      3
      3
      3
      
      -- inserting the same values in separate INSERTs works correctly
      INSERT OVERWRITE impala_char_insert VALUES (CAST("1" AS CHAR(1)));
      INSERT INTO impala_char_insert VALUES (CAST("12" AS CHAR(2)));
      INSERT INTO impala_char_insert VALUES (CAST("123" AS CHAR(3)));
      SELECT length(s) FROM impala_char_insert;
      results:
      1
      2
      3
      
      -- if one value is not CHAR(N), then the lengths are correct
      INSERT OVERWRITE impala_char_insert VALUES (CAST("1" AS CHAR(1))), (CAST("12" AS VARCHAR(2))), (CAST("123" AS CHAR(3)));
      SELECT length(s) FROM impala_char_insert;
      results:
      1
      2
      3
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              csringhofer Csaba Ringhofer

              Dates

              • Created:
                Updated:

                Issue deployment