Skip to content

Commit

Permalink
KYLIN-4418 Bug fix for ShardingHash.getShard in HBaseLookupRowEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
kyotoYaho authored and nichunen committed May 18, 2020
1 parent beb976a commit 7886a24
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -88,7 +88,8 @@ public byte[] encodeRowKey(String[] keys) {
}
byte[] result = new byte[RowConstants.ROWKEY_SHARDID_LEN + keyByteBuffer.position()];
System.arraycopy(keyByteBuffer.array(), 0, result, RowConstants.ROWKEY_SHARDID_LEN, keyByteBuffer.position());
short shard = ShardingHash.getShard(result, RowConstants.ROWKEY_SHARDID_LEN, result.length, shardNum);
short shard = ShardingHash.getShard(result, RowConstants.ROWKEY_SHARDID_LEN,
result.length - RowConstants.ROWKEY_SHARDID_LEN, shardNum);
BytesUtil.writeShort(shard, result, 0, RowConstants.ROWKEY_SHARDID_LEN);
return result;
}
Expand Down

0 comments on commit 7886a24

Please sign in to comment.