You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ss...@apache.org on 2016/06/10 08:59:05 UTC

[1/4] phoenix git commit: PHOENIX-2975 CSVBulkLoad for local index only fails.

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 8296b9857 -> df65b174d
  refs/heads/4.x-HBase-1.0 16810a8af -> d0d6964af
  refs/heads/4.x-HBase-1.1 81878a185 -> 891131c78
  refs/heads/master e7e8e130b -> 865458fbf


PHOENIX-2975 CSVBulkLoad for local index only fails.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/865458fb
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/865458fb
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/865458fb

Branch: refs/heads/master
Commit: 865458fbfa2b7f4597076351b6011ec063c3aa09
Parents: e7e8e13
Author: Sergey Soldatov <ss...@apache.org>
Authored: Thu Jun 9 17:59:51 2016 -0700
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Fri Jun 10 01:56:47 2016 -0700

----------------------------------------------------------------------
 .../phoenix/mapreduce/FormatToBytesWritableMapper.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/865458fb/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
index a736fc4..cacbce7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
@@ -248,7 +248,7 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
         if(columnIndexes.containsKey(cfn)) {
             return columnIndexes.get(cfn);
         }
-        throw new IOException("Unable to map cell to column index");
+        return -1;
     }
 
     /**
@@ -287,8 +287,14 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
                 /*
                 The order of aggregation: type, index of column, length of value, value itself
                  */
-                outputStream.writeByte(cell.getTypeByte());
                 int i = findIndex(cell);
+                if(i == -1) {
+                    //That may happen when we load only local indexes. Since KV pairs for both
+                    // table and local index are going to the same physical table at that point
+                    // we skip those KVs that are not belongs to loca index
+                    continue;
+                }
+                outputStream.writeByte(cell.getTypeByte());
                 WritableUtils.writeVInt(outputStream, i);
                 WritableUtils.writeVInt(outputStream, cell.getValueLength());
                 outputStream.write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());


[3/4] phoenix git commit: PHOENIX-2975 CSVBulkLoad for local index only fails.

Posted by ss...@apache.org.
PHOENIX-2975 CSVBulkLoad for local index only fails.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d0d6964a
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d0d6964a
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d0d6964a

Branch: refs/heads/4.x-HBase-1.0
Commit: d0d6964af67002c9290d756656bb09944726494b
Parents: 16810a8
Author: Sergey Soldatov <ss...@apache.org>
Authored: Thu Jun 9 17:59:51 2016 -0700
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Fri Jun 10 01:57:43 2016 -0700

----------------------------------------------------------------------
 .../phoenix/mapreduce/FormatToBytesWritableMapper.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d0d6964a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
index a736fc4..cacbce7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
@@ -248,7 +248,7 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
         if(columnIndexes.containsKey(cfn)) {
             return columnIndexes.get(cfn);
         }
-        throw new IOException("Unable to map cell to column index");
+        return -1;
     }
 
     /**
@@ -287,8 +287,14 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
                 /*
                 The order of aggregation: type, index of column, length of value, value itself
                  */
-                outputStream.writeByte(cell.getTypeByte());
                 int i = findIndex(cell);
+                if(i == -1) {
+                    //That may happen when we load only local indexes. Since KV pairs for both
+                    // table and local index are going to the same physical table at that point
+                    // we skip those KVs that are not belongs to loca index
+                    continue;
+                }
+                outputStream.writeByte(cell.getTypeByte());
                 WritableUtils.writeVInt(outputStream, i);
                 WritableUtils.writeVInt(outputStream, cell.getValueLength());
                 outputStream.write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());


[4/4] phoenix git commit: PHOENIX-2975 CSVBulkLoad for local index only fails.

Posted by ss...@apache.org.
PHOENIX-2975 CSVBulkLoad for local index only fails.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/891131c7
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/891131c7
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/891131c7

Branch: refs/heads/4.x-HBase-1.1
Commit: 891131c786f598e3ab8869caffffda02af86afb3
Parents: 81878a1
Author: Sergey Soldatov <ss...@apache.org>
Authored: Thu Jun 9 17:59:51 2016 -0700
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Fri Jun 10 01:58:07 2016 -0700

----------------------------------------------------------------------
 .../phoenix/mapreduce/FormatToBytesWritableMapper.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/891131c7/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
index a736fc4..cacbce7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
@@ -248,7 +248,7 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
         if(columnIndexes.containsKey(cfn)) {
             return columnIndexes.get(cfn);
         }
-        throw new IOException("Unable to map cell to column index");
+        return -1;
     }
 
     /**
@@ -287,8 +287,14 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
                 /*
                 The order of aggregation: type, index of column, length of value, value itself
                  */
-                outputStream.writeByte(cell.getTypeByte());
                 int i = findIndex(cell);
+                if(i == -1) {
+                    //That may happen when we load only local indexes. Since KV pairs for both
+                    // table and local index are going to the same physical table at that point
+                    // we skip those KVs that are not belongs to loca index
+                    continue;
+                }
+                outputStream.writeByte(cell.getTypeByte());
                 WritableUtils.writeVInt(outputStream, i);
                 WritableUtils.writeVInt(outputStream, cell.getValueLength());
                 outputStream.write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());


[2/4] phoenix git commit: PHOENIX-2975 CSVBulkLoad for local index only fails.

Posted by ss...@apache.org.
PHOENIX-2975 CSVBulkLoad for local index only fails.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/df65b174
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/df65b174
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/df65b174

Branch: refs/heads/4.x-HBase-0.98
Commit: df65b174df641d920a0ff9f142eedd7a85bde3bc
Parents: 8296b98
Author: Sergey Soldatov <ss...@apache.org>
Authored: Thu Jun 9 17:59:51 2016 -0700
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Fri Jun 10 01:57:25 2016 -0700

----------------------------------------------------------------------
 .../phoenix/mapreduce/FormatToBytesWritableMapper.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/df65b174/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
index a736fc4..cacbce7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java
@@ -248,7 +248,7 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
         if(columnIndexes.containsKey(cfn)) {
             return columnIndexes.get(cfn);
         }
-        throw new IOException("Unable to map cell to column index");
+        return -1;
     }
 
     /**
@@ -287,8 +287,14 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri
                 /*
                 The order of aggregation: type, index of column, length of value, value itself
                  */
-                outputStream.writeByte(cell.getTypeByte());
                 int i = findIndex(cell);
+                if(i == -1) {
+                    //That may happen when we load only local indexes. Since KV pairs for both
+                    // table and local index are going to the same physical table at that point
+                    // we skip those KVs that are not belongs to loca index
+                    continue;
+                }
+                outputStream.writeByte(cell.getTypeByte());
                 WritableUtils.writeVInt(outputStream, i);
                 WritableUtils.writeVInt(outputStream, cell.getValueLength());
                 outputStream.write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());