You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "yx91490 (Jira)" <ji...@apache.org> on 2022/06/22 00:57:00 UTC

[jira] [Commented] (IMPALA-11380) impala-shell's VerticalOutputFormatter may incorrectly strip trailing whitespace

    [ https://issues.apache.org/jira/browse/IMPALA-11380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17557168#comment-17557168 ] 

yx91490 commented on IMPALA-11380:
----------------------------------

Thanks [~joemcdonnell] , the VerticalOutputFormatter class  imitated the original DelimitedOutputFormatter class, so has the same problem in  IMPALA-11332.

> impala-shell's VerticalOutputFormatter may incorrectly strip trailing whitespace
> --------------------------------------------------------------------------------
>
>                 Key: IMPALA-11380
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11380
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: Impala 4.2.0
>            Reporter: Joe McDonnell
>            Priority: Major
>
> From looking at VerticalOutputFormatter, it looks like it could suffer from the same issue that we saw in IMPALA-11332
>  
> {noformat}
>     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()
> {noformat}
> 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]
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org