Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srinjoyray committed Nov 7, 2024
1 parent 889e555 commit 1f5fbe1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,15 @@ private void removeNativelySupportedComponents() {

if (!hasNonKeyInequality) {
// __key__ filters can be planned natively, so remove them
Iterator<Filter> itr = query.getFilterList().iterator();
while (itr.hasNext()) {
if (itr.next().getProperty(0).getName().equals(Entity.KEY_RESERVED_PROPERTY)) {
itr.remove();
List<Filter> filters = new ArrayList<>();
for (Filter filter : query.getFilterList()) {
if (!filter.getProperty(0).getName().equals(Entity.KEY_RESERVED_PROPERTY)) {
filters.add(filter);
}
}
query.clearFilter();
query.addAllFilter(filters);

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ private byte[] serializeEntity(VersionedEntity entity) {
Property.Builder version = stored.addPropertyBuilder();
version.setName(ENTITY_VERSION_RESERVED_PROPERTY);
version.setValue(PropertyValue.newBuilder().setInt64Value(entity.version()).build());

version.setMultiple(true);
return stored.build().toByteArray();
}

Expand Down Expand Up @@ -2869,7 +2869,7 @@ public CompiledQuery compileQuery() {

// saving the entire original query as the index
scan.setIndexNameBytes(query.toByteString());

result.setKeysOnly(false);
return result.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ public Future<byte[]> makeAsyncCall(
if (methodName.equals("RunQuery")) {
DatastoreV3Pb.Query query = DatastoreV3Pb.Query.getDefaultInstance();
try {
query.parseFrom(request);
query = query.parseFrom(request);
}catch (InvalidProtocolBufferException e) {
}
runQueryCalls.add(query);
} else if (methodName.equals("Next")) {
DatastoreV3Pb.NextRequest next = DatastoreV3Pb.NextRequest.getDefaultInstance();
try {
next.parseFrom(request);
next = next.parseFrom(request);
} catch (InvalidProtocolBufferException e) {
}
nextCalls.add(next);
Expand Down

0 comments on commit 1f5fbe1

Please sign in to comment.