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

impala-shell strips trailing whitespace from csv output

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 4.1.0
    • Impala 4.2.0, Impala 4.1.1
    • Clients
    • None

    Description

      A query like this should have trailing whitespace in the impala-shell output:

       

      impala-shell -B -q 'select "TEST NODE: Creating table       "'
      Starting Impala Shell with no authentication using Python 3.6.9
      Warning: live_progress only applies to interactive shell sessions, and is being skipped for now.
      Opened TCP connection to localhost:21050
      Connected to localhost:21050
      Server version: impalad version 4.1.0-SNAPSHOT DEBUG (build 730b7addb84839f2aebf63af501cc9e626f0d1c8)
      Query: select "TEST NODE: Creating table       "
      Query submitted at: 2022-06-01 12:37:58 (Coordinator: http://joemcdonnell:25000)
      Query progress can be monitored at: http://joemcdonnell:25000/query_plan?query_id=3743cf7e04b44e18:5ee28b3b00000000
      TEST NODE: Creating table <----- whitespace should exist here
      Fetched 1 row(s) in 0.11s

      This is due to this rstrip() call here:

       

      https://github.com/apache/impala/blob/master/shell/shell_output.py#L93

       

          for row in rows:
            if sys.version_info.major == 2:
              row = [val.encode('utf-8', 'replace') if isinstance(val, unicode) else val
                  for val in row]
            writer.writerow(row)
          rows = temp_buffer.getvalue().rstrip() <--------
          temp_buffer.close()
          return rows

       

       

      Attachments

        Issue Links

          Activity

            People

              joemcdonnell Joe McDonnell
              joemcdonnell Joe McDonnell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: