Skip to content

Commit 52cf69f

Browse files
Zhou-jwshenyunlong
authored andcommitted
add constructing new_kv if-clause
1 parent 4f42647 commit 52cf69f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/main/java/com/alipay/oceanbase/hbase/OHTable.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,14 +2017,15 @@ private QueryAndMutate buildDeleteQueryAndMutate(KeyValue kv,
20172017
KeyValue.Type kvType = KeyValue.Type.codeToType(kv.getType().getCode());
20182018
com.alipay.oceanbase.rpc.mutation.Mutation tableMutation = buildMutation(kv, operationType,
20192019
isTableGroup, family, TTL);
2020-
// construct new_kv otherwise filter will fail to match targeted columns
2021-
byte[] oldQualifier = CellUtil.cloneQualifier(kv);
2022-
byte[] newQualifier = new byte[family.length + 1/* length of "." */ + oldQualifier.length];
2023-
System.arraycopy(family, 0, newQualifier, 0, family.length);
2024-
newQualifier[family.length] = 0x2E; // 0x2E in utf-8 is "."
2025-
System.arraycopy(oldQualifier, 0, newQualifier, family.length + 1, oldQualifier.length);
2026-
kv = modifyQualifier(kv, newQualifier);
2027-
2020+
if(isTableGroup) {
2021+
// construct new_kv otherwise filter will fail to match targeted columns
2022+
byte[] oldQualifier = CellUtil.cloneQualifier(kv);
2023+
byte[] newQualifier = new byte[family.length + 1/* length of "." */ + oldQualifier.length];
2024+
System.arraycopy(family, 0, newQualifier, 0, family.length);
2025+
newQualifier[family.length] = 0x2E; // 0x2E in utf-8 is "."
2026+
System.arraycopy(oldQualifier, 0, newQualifier, family.length + 1, oldQualifier.length);
2027+
kv = modifyQualifier(kv, newQualifier);
2028+
}
20282029
ObNewRange range = new ObNewRange();
20292030
ObTableQuery tableQuery = new ObTableQuery();
20302031
tableQuery.setObKVParams(buildOBKVParams((Scan) null));

0 commit comments

Comments
 (0)