You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/01/10 04:07:01 UTC

(hbase) branch branch-2.4 updated: HBASE-28297 IntegrationTestImportTsv fails with ArrayIndexOfOutBounds (#5612)

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

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new d7052a573ab HBASE-28297 IntegrationTestImportTsv fails with ArrayIndexOfOutBounds (#5612)
d7052a573ab is described below

commit d7052a573abadb4bd2bf351f8c7f9b4b9ebb3fe5
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Wed Jan 10 11:13:09 2024 +0800

    HBASE-28297 IntegrationTestImportTsv fails with ArrayIndexOfOutBounds (#5612)
    
    Signed-off-by: Nihal Jain <ni...@apache.org>
    (cherry picked from commit a09305d5854fc98300426271fad3b53a69d2ae71)
---
 .../apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
index 8f13d826e6e..ec27edc66f4 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
@@ -60,6 +60,9 @@ import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+import org.apache.hbase.thirdparty.com.google.common.base.Strings;
+
 /**
  * Validate ImportTsv + LoadIncrementalHFiles on a distributed cluster.
  */
@@ -83,7 +86,10 @@ public class IntegrationTestImportTsv extends Configured implements Tool {
       private static final long serialVersionUID = 1L;
       {
         byte[] family = Bytes.toBytes("d");
-        for (String line : simple_tsv.split("\n")) {
+        for (String line : Splitter.on('\n').split(simple_tsv)) {
+          if (Strings.isNullOrEmpty(line)) {
+            continue;
+          }
           String[] row = line.split("\t");
           byte[] key = Bytes.toBytes(row[0]);
           long ts = Long.parseLong(row[1]);