Pivotal GemFire® v8.2

SELECT Projection List

SELECT Projection List

The projections in the SELECT projection list are used to transform the results of the WHERE search operation.

You specify the projection list either as * or as a comma delimited list of expressions. For *, the interim results of the WHERE clause are returned from the query. Otherwise, the set of objects in the interim results are iterated and the projections applied to each of the objects. During the application of the projection list, the attributes of the objects being traversed are in scope for name resolution.

You can also specify retrieval of the entry keys in your projection list. This allows you to access the associated cached entries for modification and other purposes. The following example shows how the Region entry key can be obtained by using the region entries in the FROM clause and using appropriate projections. This query runs on the /portfolios region, returning a set of struct<key:string, id:string, secId:string> where key is the key of the region entry, id is an entry ID, and secId is a secId of a positionsmap for the entry.

SELECT DISTINCT key,, posnVal.secId

FROM /portfolios.entrySet entry, entry.value.positions.values posnVal

WHERE entry.value."type" = 'xyz' AND posnVal.secId = 'XXX'