Thanks Jason/Anil for the reply!

Jason,
It's exactly the same output I am also getting for option 1 and option 2.

Now with your option 1, if you try to apply filter like I have 
IS_DEFINED(empd.something) it won't get filtered.

In your case your linked list has "ObjectX". Assume that ObjectX is instance of 
java class "Customer" having field as "country". Now as customer object is 
within LinkedList, Option 1 would fail with filter 
(IS_DEFINEE(objectX.country)).

Option2 works but it then changes the layout of output and in real world output 
is sent back as xml/json to business service.

Could you try that as well for Option 1?

Anil,

In both the options, my filter and outcome should be same as per my queries but 
layout is different.

In one case I am directly asking "service.dependencies" and in another case I 
am asking "alias" for "service.dependenies".

But the issue is Option1 does not give right outcome as filter condition is not 
being applied.

In real world, the actual object stored in geode itself is de normalized 
document. In my example "Dependencies grouped by service name"

Now if I again have to write code to group them(Map<Service,LinkedList>) then 
it defeats the purpose of having such prepared de normalized model for 
efficiency.

I hope that makes sense.

Dharam

Sent with BlackBerry Work (www.blackberry.com)
________________________________
From: Jason Huynh <jhu...@pivotal.io>
Sent: Feb 22, 2018 00:20
To: user@geode.apache.org
Subject: Re: LinkedList with OQL not working

Correction, empd not empty, not sure how autocorrect came into play.

On Wed, Feb 21, 2018 at 10:48 AM Jason Huynh 
<jhu...@pivotal.io<mailto:jhu...@pivotal.io>> wrote:
I just tried similar queries and get the following output
Option1:
struct(ID:1,linkedList:[ObjectA, ObjectB])
struct(ID:1,linkedList:[ObjectA, ObjectB])
struct(ID:3,linkedList:[ObjectC, ObjectD])
struct(ID:3,linkedList:[ObjectC, ObjectD])

If I add a distinct keyword then I get only 2 rows:
struct(ID:1,linkedList:[ObjectA, ObjectB])
struct(ID:3,linkedList:[ObjectC, ObjectD])

Option2:
struct(ID:3,empd:ObjectD)
struct(ID:1,empd:ObjectA)
struct(ID:1,empty:ObjectB)
struct(ID:3,empd:ObjectC)

Adding an order by I can get them ordered by ID and empty
struct(ID:1,empd:ObjectA)
struct(ID:1,empty:ObjectB)
struct(ID:3,empty:ObjectC)
struct(ID:3,empd:ObjectD)


On Wed, Feb 21, 2018 at 10:30 AM Jason Huynh 
<jhu...@pivotal.io<mailto:jhu...@pivotal.io>> wrote:
In option1, are you receiving the linked list or is it not returning the values 
at all?
Is the problem in option1 just a display issue?

For option2,  you might be able to do a distinct with an order by but that will 
force uniqueness in the tupling which you may not be looking for.

On Wed, Feb 21, 2018 at 6:10 AM Thacker, Dharam 
<dharam.thac...@jpmorgan.com<mailto:dharam.thac...@jpmorgan.com>> wrote:
Hello Team,

I am unable to apply any filter conditions using OQL if collection is of type 
LinkedList. Below query does not work as expected.
Below query gives me dependencies grouped at service name level and array of 
depenencies under it.

Option1:
select 
service.name<https://secureweb.jpmchase.net/readonly/http://service.name>, 
service.dependencies from /Service service,service.dependancies empd where 
IS_DEFINED(empd.something)

Output:
Each row = serviceName -> {LinkedList}

Option2:
If I change query like below one then it gives filtered result but I don’t get 
grouped by service name at every result comes as individual element.

select 
service.name<https://secureweb.jpmchase.net/readonly/http://service.name>, empd 
from /Service service,service.dependancies empd where IS_DEFINED(empd.something)

Output:
Each row >>
serviceName -> empd1
serviceName -> empd2
serviceName -> empd3

Is there any such limitation?
Anything we can do to achieve this?

Thanks & Regards,
Dharam


This message is confidential and subject to terms at: 
http://www.jpmorgan.com/emaildisclaimer<http://www.jpmorgan.com/emaildisclaimer>
 including on confidentiality, legal privilege, viruses and monitoring of 
electronic messages. If you are not the intended recipient, please delete this 
message and notify the sender immediately. Any unauthorized use is strictly 
prohibited.

This message is confidential and subject to terms at: 
http://www.jpmorgan.com/emaildisclaimer including on confidentiality, legal 
privilege, viruses and monitoring of electronic messages. If you are not the 
intended recipient, please delete this message and notify the sender 
immediately. Any unauthorized use is strictly prohibited.

Reply via email to