AggregationQuery doesn't respect namespace from com.google.cloud.datastore.Datastore
object
#1054
Labels
api: datastore
Issues related to the googleapis/java-datastore API.
Given
I have
2 entities
stored forTask
kind under the namespacens1
and i configure acom.google.cloud.datastore.Datastore
service withns1
namespace.Scenario
When I try to run entity query with or without namespace through the
com.google.cloud.datastore.Datastore
object configured with namespace, i get same results, whereas in case ofAggregationQuery
i don't.Code example
Problem
last query execution of
aggregationQueryWithoutNamespace
returns 0 count.Explanation
If a namespace is configured in
AggragationQuery
the library will use that namespace to run that query, and if it's not present, it'll completely ignore the one configured incom.google.cloud.datastore.Datastore
service and simply run the query in default namespace and hence the diff in output.java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/execution/request/AggregationQueryRequestProtoPreparer.java
Lines 92 to 99 in 412be61
This part of code needs to be changed, where we can give priority to the namespace from
AggregationQuery
followed bycom.google.cloud.datastore.Datastore
service to keep it consistent with the Entity query.Thanks!
The text was updated successfully, but these errors were encountered: