This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tez.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ed5e3296 TEZ-4523: Findbugs build is broken tez-tfile-parser. (#319) 
(Ayush Saxena reviewed by Laszlo Bodor)
0ed5e3296 is described below

commit 0ed5e3296c55dda66c691a9c60d1db38f0c80ce5
Author: Ayush Saxena <ayushsax...@apache.org>
AuthorDate: Mon Dec 4 18:37:30 2023 +0530

    TEZ-4523: Findbugs build is broken tez-tfile-parser. (#319) (Ayush Saxena 
reviewed by Laszlo Bodor)
---
 tez-tools/tez-tfile-parser/findbugs-exclude.xml          | 16 ++++++++++++++++
 .../java/org/apache/tez/tools/TFileRecordReader.java     |  5 +++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/tez-tools/tez-tfile-parser/findbugs-exclude.xml 
b/tez-tools/tez-tfile-parser/findbugs-exclude.xml
new file mode 100644
index 000000000..5b11308f6
--- /dev/null
+++ b/tez-tools/tez-tfile-parser/findbugs-exclude.xml
@@ -0,0 +1,16 @@
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<FindBugsFilter>
+
+</FindBugsFilter>
diff --git 
a/tez-tools/tez-tfile-parser/src/main/java/org/apache/tez/tools/TFileRecordReader.java
 
b/tez-tools/tez-tfile-parser/src/main/java/org/apache/tez/tools/TFileRecordReader.java
index 4d6c0f238..41744676e 100644
--- 
a/tez-tools/tez-tfile-parser/src/main/java/org/apache/tez/tools/TFileRecordReader.java
+++ 
b/tez-tools/tez-tfile-parser/src/main/java/org/apache/tez/tools/TFileRecordReader.java
@@ -37,6 +37,7 @@ import java.io.BufferedReader;
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 
 /**
  * Simple record reader which reads the TFile and emits it as key, value pair.
@@ -84,7 +85,7 @@ public class TFileRecordReader extends RecordReader<Text, 
Text> {
     //splitpath contains the machine name. Create the key as splitPath + 
realKey
     String keyStr = new StringBuilder()
         .append(splitPath.getName()).append(":")
-        .append(new String(keyBytesWritable.getBytes()))
+        .append(new String(keyBytesWritable.getBytes(), 
StandardCharsets.UTF_8))
         .toString();
 
     /**
@@ -92,7 +93,7 @@ public class TFileRecordReader extends RecordReader<Text, 
Text> {
      * better to handle such scenarios.
      */
     currentValueReader = new BufferedReader(
-        new InputStreamReader(entry.getValueStream()));
+        new InputStreamReader(entry.getValueStream(), StandardCharsets.UTF_8));
     key.set(keyStr);
     String line = currentValueReader.readLine();
     value.set((line == null) ? "" : line);

Reply via email to