Re: Error compiling query: entire LINQ expression should bespecifiedwithin lambda passed to Compile method. Part of the query can't beoutsidethe Compile method call.
Hi, when i tried with DateTime type using where clause, then also getting the following exception *Method not supported: System.DateTime.(Int32 CompareTo(System.DateTime)) * Please suggest if any other way to query with DateTime type. Thanks siva -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Error compiling query: entire LINQ expression should bespecifiedwithin lambda passed to Compile method. Part of the query can't beoutsidethe Compile method call.
Hi, when i tried with DateTime type using where clause, then also getting the following exception Method not supported: System.DateTime.(Int32 CompareTo(System.DateTime)) var compileQuery = CompiledQuery.Compile((DateTime tempDate) => cache1.Where(data => (data.Value.CreatedDateTime.CompareTo(prodDate)) == 0)); Please suggest if any other way to query with DateTime type. Thanks siva -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Error compiling query: entire LINQ expression should bespecifiedwithin lambda passed to Compile method. Part of the query can't beoutsidethe Compile method call.
I've got to the bottom of this, it is indeed a bug [1] The workaround is to use a different overload [2], this works: CompiledQueryFunc> issueqry = CompiledQuery.Compile(queryable.Where(emp => emp.Value.Name == "unused_value")); foreach (var entry in issueqry("abc")) Console.WriteLine(">>>" + entry.Value.Name); [1] https://issues.apache.org/jira/browse/IGNITE-11985 [2] https://ignite.apache.org/releases/latest/dotnetdoc/api/Apache.Ignite.Linq.CompiledQuery.html#Apache_Ignite_Linq_CompiledQuery_Compile__1_System_Linq_IQueryable___0__ On Mon, Jul 15, 2019 at 8:04 PM Alexandr Shapkin wrote: > Hi! > > > > As I understand correctly, right now CompiledQuery won’t work if there is > a non-primitive value inside the WHERE clause. > > > > This seems like a bug for me, because it’s pretty common to treat String > class as a primitive one. > > Right now you can rewrite your query to “x.Contains(y)” or > “x.StartsWith(y)”, but it’s not the same as Equals. > > > > *From: *siva > *Sent: *Friday, July 12, 2019 9:36 PM > *To: *user@ignite.apache.org > *Subject: *RE: Error compiling query: entire LINQ expression should > bespecifiedwithin lambda passed to Compile method. Part of the query can't > beoutsidethe Compile method call. > > > > Hi , > > > > > > Thanks for reply > > > > > > i have attached sample code git hub link.please verify it . > > > > > > > > > > > > > > Thanks > > siva https://github.com/cvakarna/ApacheIgnite/blob/master/Program.cs > > <https://github.com/cvakarna/ApacheIgnite/blob/master/Program.cs> > > > > > > > > -- > > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > > >
RE: Error compiling query: entire LINQ expression should bespecifiedwithin lambda passed to Compile method. Part of the query can't beoutsidethe Compile method call.
Hi! As I understand correctly, right now CompiledQuery won’t work if there is a non-primitive value inside the WHERE clause. This seems like a bug for me, because it’s pretty common to treat String class as a primitive one. Right now you can rewrite your query to “x.Contains(y)” or “x.StartsWith(y)”, but it’s not the same as Equals. From: siva Sent: Friday, July 12, 2019 9:36 PM To: user@ignite.apache.org Subject: RE: Error compiling query: entire LINQ expression should bespecifiedwithin lambda passed to Compile method. Part of the query can't beoutsidethe Compile method call. Hi , Thanks for reply i have attached sample code git hub link.please verify it . Thanks siva https://github.com/cvakarna/ApacheIgnite/blob/master/Program.cs <https://github.com/cvakarna/ApacheIgnite/blob/master/Program.cs> -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/