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

impala-shell with Python 3 mangles binary output

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.3.0
    • Impala 4.4.0
    • None

    Description

      With a table containing binary data such as

      CREATE TABLE complex_datatype (A INT, b BINARY);
      INSERT INTO complex_datatype VALUES (1, CAST("a" as BINARY)), (2, CAST("8" as BINARY)), (3, CAST(NULL as BINARY));
      

      querying it with Python 3 mangles the output by prefixing it with 'b' and quoting it

      $ IMPALA_PYTHON_EXECUTABLE=python3 impala-shell.sh -q 'select * from complex_datatype'
      ...
      +---+------+
      | a | b    |
      +---+------+
      | 1 | b'a' |
      | 2 | b'8' |
      | 3 | NULL |
      +---+------+
      Fetched 3 row(s) in 0.11s
      

      This should look like

      +---+------+
      | a | b    |
      +---+------+
      | 1 | a    |
      | 2 | 8    |
      | 3 | NULL |
      +---+------+
      

      Behaves the same when outputting to a file as well, with and without -B.

      The beeswax protocol works fine, so this is specific to the hs2 client.

      Attachments

        Activity

          People

            MikaelSmith Michael Smith
            MikaelSmith Michael Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: