Retrieving all keys in a PState

30 views
Skip to first unread message

jacob franco

unread,
Nov 15, 2024, 1:44:16 PM11/15/24
to rama-user
So I have this simple PState, teamIdToTeam, which maps a team's id (Integer) to the team object, and we want to just get all of the ids from the PState. 

I attempted to get all of the keys like so:

241115_13h34m17s_screenshot.png

But I'm getting an error of: InvalidQueryPathException: null {} and I'm not really sure why.  I know that the PState is populated properly and we know that the PState is a map schema mapping an Integer to a Team.  I thought that Path.all().mapKeys() would just give me all the keys in the PState as a list. 

Any insight is appreciated!

Nathan Marz

unread,
Nov 15, 2024, 1:58:11 PM11/15/24
to rama...@googlegroups.com
A foreign PState select queries one partition of the PState, so the invoke needs to know which partition to query. By default this is done by using the key in a leading "key" navigator in the path. Alternatively, you can specify the partitioning key explicitly via a different variant of "select". If you want to query all partitions of a PState, you should make a query topology.

Some resources from the docs regarding this:

--
You received this message because you are subscribed to the Google Groups "rama-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rama-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/rama-user/3f792377-ca3b-4547-a9c9-70353eff856bn%40googlegroups.com.

jacob franco

unread,
Nov 15, 2024, 5:26:29 PM11/15/24
to rama-user
Okay yeah, just making a topology querying all partitions worked.  Thanks!
Reply all
Reply to author
Forward
0 new messages