使用milvus java sdk的QueryIterator出现报错:id > \Q123456\, error: line 1:12 token recognition error at: '\'
feriki opened this issue · 3 comments
feriki commented
xiaofan-luan commented
I thought we can not just append something to string.
@MrPresent-Han please help on it
xiaofan-luan commented
public static byte[] incrementBytes(byte[] value) {
if (value == null || value.length == 0) {
throw new IllegalArgumentException("Input byte array cannot be null or empty");
}
byte[] newValue = value.clone();
boolean carry = true;
int index = newValue.length - 1;
while (carry && index >= 0) {
if (newValue[index] == (byte) 0xFF) {
newValue[index] = 0;
index--;
} else {
newValue[index]++;
carry = false;
}
}
// If carry is still true, this means we have overflowed beyond the most significant byte
if (carry) {
byte[] extendedValue = new byte[newValue.length + 1];
System.arraycopy(newValue, 0, extendedValue, 1, newValue.length);
extendedValue[0] = 1; // Add a new leading byte
return extendedValue;
}
return newValue;
}