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

impala-shell's VerticalOutputFormatter may incorrectly strip trailing whitespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.2.0
    • Impala 4.2.0
    • Clients
    • None
    • ghx-label-10

    Description

      From looking at VerticalOutputFormatter, it looks like it could suffer from the same issue that we saw in IMPALA-11332

       

          for r, row in enumerate(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(["************************************** " +
              str(r + 1) + ".row **************************************"])
            for c, val in enumerate(row):
              row[c] = self.column_names[c].rjust(self.column_name_max_len) + ": " + val
            writer.writerow(row)
          rows = temp_buffer.getvalue().rstrip() <------- here
          temp_buffer.close()
      

      We should verify the problem and fix it. It seems like the rstrip() should follow the solution from IMPALA-11332 and strip only the newline.

      See https://github.com/apache/impala/commit/c41e6941cafad453819b57e78b2083a3e64496e0

       

       

      Attachments

        Issue Links

          Activity

            People

              yx91490 XiangYang
              joemcdonnell Joe McDonnell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: