You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Tuo, Erming" <er...@sap.com> on 2018/03/09 19:52:55 UTC

Re: [CAUTION] RE: behavior changes in Olingo 4.4.0

Thank you, Oliver. Are you saying that if the type of the filter property is collection based (array, list etc..), then we have to use lamba based expression now?

Erming Tuo
PTO 03/18-04/03
LMS software Development Architect 
SAP SuccessFactors | 2000 Edmund Halley, Reston, VA
US +1 703-678-0615
 


This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
 
 
On 3/7/18, 3:15 PM, "Grande, Oliver" <ol...@sap.com> wrote:

    Hello Erming,
    
    I assume you  like to find all students, which have at least one teacher that has either smith, john or mary as part of his/her name in that case the following should work:
    
    /odatav4/school-service/Students?$filter= teachers/any(s:contains(s, 'smith') or contains(s, 'john') or contains(s, 'mary'))
    
    Regards,
    Oliver
    
    
    From: Tuo, Erming [mailto:erming.tuo@sap.com]
    Sent: Mittwoch, 7. März 2018 19:40
    To: dev@olingo.apache.org; user@olingo.apache.org
    Cc: Xue, Zhongyuan <zh...@sap.com>; Vivaramneni, Sridhar <sr...@sap.com>
    Subject: [CAUTION] Re: behavior changes in Olingo 4.4.0
    
    Hi,
    
    Can someone please help? We are held up by this issue.
    
    thx
    
    Erming Tuo
    PTO 03/18-04/03
    LMS software Development Architect
    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA
    US +1 703-678-0615
    
    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]
    
    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
    
    
    From: "Tuo, Erming" <er...@sap.com>>
    Date: Tuesday, March 6, 2018 at 11:35 AM
    To: "dev@olingo.apache.org<ma...@olingo.apache.org>" <de...@olingo.apache.org>>, "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
    Cc: "Xue, Zhongyuan" <zh...@sap.com>>, "Vivaramneni, Sridhar" <sr...@sap.com>>
    Subject: behavior changes in Olingo 4.4.0
    
    Team,
    
    We are upgrading from Olingo 4.2 to Olingo 4.4 and ran into an unexpected change of behavior of the library.
    
    Here is the URL of the API
    
    Get /odatav4/school-service/Students?$filter=teachers eq ‘smith,john,mary’
    
    Teachers is of String collection type, we use comma as delimiter and pass in the expression as one String, it uses to work fine in 4.2, but in 4.4, we got the “Collection not allowed.” error. By looking at the source code of 4.4.0, it is due to the new method in ExpressionParser. checkNoCollection
    
    Can you please suggest what is the correct format of filter we need to pass in then?
    
    thx
    
    
    Erming Tuo
    PTO 03/18-04/03
    LMS software Development Architect
    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA
    US +1 703-678-0615
    
    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]
    
    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.
    
    
    


RE: [CAUTION] RE: behavior changes in Olingo 4.4.0

Posted by "Grande, Oliver" <ol...@sap.com>.
Hello Erming,



at least that's my understanding. The documentation (OData Version 4.0. Part 2: URL Conventions Plus Errata 03 part  5.1.1.10 Lambda Operators<http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358>) states “OData defines two operators that evaluate a Boolean expression on a collection.”, which are collection attributes as well as navigation properties.



Just for completeness: In case the path contains the collation and the collection is complex you are able to filter on it e.g. …/Students(‘2514’)/teachers?$filter=name eq ‘mary’. This requires that the key of the student is given.



Regards,

Oliver







-----Original Message-----
From: Tuo, Erming [mailto:erming.tuo@sap.com]
Sent: Freitag, 9. März 2018 20:53
To: dev@olingo.apache.org; user@olingo.apache.org
Cc: Xue, Zhongyuan <zh...@sap.com>; Vivaramneni, Sridhar <sr...@sap.com>
Subject: [CAUTION] Re: [CAUTION] RE: behavior changes in Olingo 4.4.0



Thank you, Oliver. Are you saying that if the type of the filter property is collection based (array, list etc..), then we have to use lamba based expression now?



Erming Tuo

PTO 03/18-04/03

LMS software Development Architect

SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

US +1 703-678-0615





This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.



On 3/7/18, 3:15 PM, "Grande, Oliver" <ol...@sap.com>> wrote:



    Hello Erming,



    I assume you  like to find all students, which have at least one teacher that has either smith, john or mary as part of his/her name in that case the following should work:



    /odatav4/school-service/Students?$filter= teachers/any(s:contains(s, 'smith') or contains(s, 'john') or contains(s, 'mary'))



    Regards,

    Oliver





    From: Tuo, Erming [mailto:erming.tuo@sap.com]

    Sent: Mittwoch, 7. März 2018 19:40

    To: dev@olingo.apache.org<ma...@olingo.apache.org>; user@olingo.apache.org<ma...@olingo.apache.org>

    Cc: Xue, Zhongyuan <zh...@sap.com>>; Vivaramneni, Sridhar <sr...@sap.com>>

    Subject: [CAUTION] Re: behavior changes in Olingo 4.4.0



    Hi,



    Can someone please help? We are held up by this issue.



    thx



    Erming Tuo

    PTO 03/18-04/03

    LMS software Development Architect

    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

    US +1 703-678-0615



    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]



    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.





    From: "Tuo, Erming" <er...@sap.com>>>

    Date: Tuesday, March 6, 2018 at 11:35 AM

    To: "dev@olingo.apache.org<ma...@olingo.apache.org><mailto:dev@olingo.apache.org%3cmailto:dev@olingo.apache.org%3e>" <de...@olingo.apache.org>>>, "user@olingo.apache.org<ma...@olingo.apache.org><mailto:user@olingo.apache.org%3cmailto:user@olingo.apache.org%3e>" <us...@olingo.apache.org>>>

    Cc: "Xue, Zhongyuan" <zh...@sap.com>>>, "Vivaramneni, Sridhar" <sr...@sap.com>>>

    Subject: behavior changes in Olingo 4.4.0



    Team,



    We are upgrading from Olingo 4.2 to Olingo 4.4 and ran into an unexpected change of behavior of the library.



    Here is the URL of the API



    Get /odatav4/school-service/Students?$filter=teachers eq ‘smith,john,mary’



    Teachers is of String collection type, we use comma as delimiter and pass in the expression as one String, it uses to work fine in 4.2, but in 4.4, we got the “Collection not allowed.” error. By looking at the source code of 4.4.0, it is due to the new method in ExpressionParser. checkNoCollection



    Can you please suggest what is the correct format of filter we need to pass in then?



    thx





    Erming Tuo

    PTO 03/18-04/03

    LMS software Development Architect

    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

    US +1 703-678-0615



    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]



    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.









RE: [CAUTION] RE: behavior changes in Olingo 4.4.0

Posted by "Grande, Oliver" <ol...@sap.com>.
Hello Erming,



at least that's my understanding. The documentation (OData Version 4.0. Part 2: URL Conventions Plus Errata 03 part  5.1.1.10 Lambda Operators<http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358>) states “OData defines two operators that evaluate a Boolean expression on a collection.”, which are collection attributes as well as navigation properties.



Just for completeness: In case the path contains the collation and the collection is complex you are able to filter on it e.g. …/Students(‘2514’)/teachers?$filter=name eq ‘mary’. This requires that the key of the student is given.



Regards,

Oliver







-----Original Message-----
From: Tuo, Erming [mailto:erming.tuo@sap.com]
Sent: Freitag, 9. März 2018 20:53
To: dev@olingo.apache.org; user@olingo.apache.org
Cc: Xue, Zhongyuan <zh...@sap.com>; Vivaramneni, Sridhar <sr...@sap.com>
Subject: [CAUTION] Re: [CAUTION] RE: behavior changes in Olingo 4.4.0



Thank you, Oliver. Are you saying that if the type of the filter property is collection based (array, list etc..), then we have to use lamba based expression now?



Erming Tuo

PTO 03/18-04/03

LMS software Development Architect

SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

US +1 703-678-0615





This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.



On 3/7/18, 3:15 PM, "Grande, Oliver" <ol...@sap.com>> wrote:



    Hello Erming,



    I assume you  like to find all students, which have at least one teacher that has either smith, john or mary as part of his/her name in that case the following should work:



    /odatav4/school-service/Students?$filter= teachers/any(s:contains(s, 'smith') or contains(s, 'john') or contains(s, 'mary'))



    Regards,

    Oliver





    From: Tuo, Erming [mailto:erming.tuo@sap.com]

    Sent: Mittwoch, 7. März 2018 19:40

    To: dev@olingo.apache.org<ma...@olingo.apache.org>; user@olingo.apache.org<ma...@olingo.apache.org>

    Cc: Xue, Zhongyuan <zh...@sap.com>>; Vivaramneni, Sridhar <sr...@sap.com>>

    Subject: [CAUTION] Re: behavior changes in Olingo 4.4.0



    Hi,



    Can someone please help? We are held up by this issue.



    thx



    Erming Tuo

    PTO 03/18-04/03

    LMS software Development Architect

    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

    US +1 703-678-0615



    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]



    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.





    From: "Tuo, Erming" <er...@sap.com>>>

    Date: Tuesday, March 6, 2018 at 11:35 AM

    To: "dev@olingo.apache.org<ma...@olingo.apache.org><mailto:dev@olingo.apache.org%3cmailto:dev@olingo.apache.org%3e>" <de...@olingo.apache.org>>>, "user@olingo.apache.org<ma...@olingo.apache.org><mailto:user@olingo.apache.org%3cmailto:user@olingo.apache.org%3e>" <us...@olingo.apache.org>>>

    Cc: "Xue, Zhongyuan" <zh...@sap.com>>>, "Vivaramneni, Sridhar" <sr...@sap.com>>>

    Subject: behavior changes in Olingo 4.4.0



    Team,



    We are upgrading from Olingo 4.2 to Olingo 4.4 and ran into an unexpected change of behavior of the library.



    Here is the URL of the API



    Get /odatav4/school-service/Students?$filter=teachers eq ‘smith,john,mary’



    Teachers is of String collection type, we use comma as delimiter and pass in the expression as one String, it uses to work fine in 4.2, but in 4.4, we got the “Collection not allowed.” error. By looking at the source code of 4.4.0, it is due to the new method in ExpressionParser. checkNoCollection



    Can you please suggest what is the correct format of filter we need to pass in then?



    thx





    Erming Tuo

    PTO 03/18-04/03

    LMS software Development Architect

    SAP SuccessFactors | 2000 Edmund Halley, Reston, VA

    US +1 703-678-0615



    [cid:E0BBB916-1B85-490F-B852-EA52F290EC0D]



    This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.