Skip to main content
Question

Sdk instance query for grouping


Hello Team,

We have three views:

→ ScalarProperty{

#other fields

entity: Entity

}

→ Entity{

#other fields

entitytype: EntityType

}

→ EntityType{

externalId

}

Given this, from ScalarProperty view, can we use groupby on entity.entityType.externalId when querying instances and counting them using the query API, or is there another way to achieve this?

2 replies


AndersM
Seasoned Practitioner
  • Seasoned Practitioner
  • 33 replies
  • March 24, 2025

Hi Shivani,

My understanding of the question is that you would like to perform a count of instances with the ScalarProperty view grouped by entity->entityType->externalId. I’m afraid this isn’t possible, as aggregation operations cannot perform graph traversal, even across just one relation. Aggregation operations have to scan all instances of a type to evaluate a query, so they are constrained to operating on primitive fields only, to make sure that queries can be executed in a timely fashion.

Thanks,

-AndersM

 


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings