You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Marcono1234 (Jira)" <ji...@apache.org> on 2021/03/27 17:39:00 UTC

[jira] [Created] (HADOOP-17607) TFileDumper creates malformed hex sample output

Marcono1234 created HADOOP-17607:
------------------------------------

             Summary: TFileDumper creates malformed hex sample output
                 Key: HADOOP-17607
                 URL: https://issues.apache.org/jira/browse/HADOOP-17607
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 3.2.2
            Reporter: Marcono1234


{{org.apache.hadoop.io.file.tfile.TFileDumper}} creates malformed hex output:
{code}
out.print("0X");
for (int j = 0; j < sampleLen; ++j) {
  byte b = key[i];
  out.printf("%X", b);
}
{code}
It should use {{"%02X"}} (zero-pad and use width 2) as formatting pattern; otherwise bytes < 16 will only have on hex char and for example both {{1, 0}} and {{16}} would have the result {{"10"}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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