You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Oleg Bevz (Jira)" <ji...@apache.org> on 2021/04/12 12:35:00 UTC

[jira] [Updated] (IGNITE-14523) Support for string.Compare method in Apache Ignite LINQ provider

     [ https://issues.apache.org/jira/browse/IGNITE-14523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Bevz updated IGNITE-14523:
-------------------------------
    Description: 
Hello, current Apache Ignite does not support string comparison in LINQ provider (Apache.Ignite.Linq project).

For example following modified query insideThinClientQueryExample.ScanQueryExample method will throw Exception:

var employees = cache.AsCacheQueryable().Select(x => x.Value).Where(x => string.Compare(x.Name, "Daniel Adams") >= 0);

Business case: in our projects we use DevExteme.AspNet.Data library to build LINQ queries for Apache Ignite and in some cases the library builds complex queries with string.Compare method call. 

Exception details:
 Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotSupportedException: Method not supported: System.String.(Int32 Compare(System.String, System.String))
    at Apache.Ignite.Linq.Impl.MethodVisitor.VisitMethodCall(MethodCallExpression expression, CacheQueryExpressionVisitor visitor)
    at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitMethodCall(MethodCallExpression expression)
    at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
    at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
    at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
    at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
    at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
    at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitWhereClause(WhereClause whereClause, Int32 index, Boolean hasGroups)
    at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.ProcessGroupings(QueryModel queryModel)
    at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitBodyClauses(ObservableCollection`1 bodyClauses, QueryModel queryModel)
    at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
    at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitQueryModel(QueryModel queryModel, Boolean includeAllFields, Boolean copyAliases)
    at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.GenerateQuery(QueryModel queryModel)
    at Apache.Ignite.Linq.Impl.CacheFieldsQueryExecutor.ExecuteCollection[T](QueryModel queryModel)
    at Remotion.Linq.Clauses.StreamedData.StreamedSequenceInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
    at Apache.Ignite.Linq.Impl.CacheFieldsQueryProvider.Execute[TResult](Expression expression)
  

  was:
Hello, current Apache Ignite does not support string comparison in LINQ provider (Apache.Ignite.Linq project).

For example following modified query insideThinClientQueryExample.ScanQueryExample method will throw Exception:

var employees = cache.AsCacheQueryable().Select(x => x.Value).Where(x => string.Compare(x.Name, "Daniel Adams") >= 0);
Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotSupportedException: Method not supported: System.String.(Int32 Compare(System.String, System.String))
   at Apache.Ignite.Linq.Impl.MethodVisitor.VisitMethodCall(MethodCallExpression expression, CacheQueryExpressionVisitor visitor)
   at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitMethodCall(MethodCallExpression expression)
   at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
   at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
   at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
   at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
   at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
   at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitWhereClause(WhereClause whereClause, Int32 index, Boolean hasGroups)
   at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.ProcessGroupings(QueryModel queryModel)
   at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitBodyClauses(ObservableCollection`1 bodyClauses, QueryModel queryModel)
   at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
   at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitQueryModel(QueryModel queryModel, Boolean includeAllFields, Boolean copyAliases)
   at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.GenerateQuery(QueryModel queryModel)
   at Apache.Ignite.Linq.Impl.CacheFieldsQueryExecutor.ExecuteCollection[T](QueryModel queryModel)
   at Remotion.Linq.Clauses.StreamedData.StreamedSequenceInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
   at Apache.Ignite.Linq.Impl.CacheFieldsQueryProvider.Execute[TResult](Expression expression)
 


> Support for string.Compare method in Apache Ignite LINQ provider
> ----------------------------------------------------------------
>
>                 Key: IGNITE-14523
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14523
>             Project: Ignite
>          Issue Type: New Feature
>          Components: thin client
>    Affects Versions: 2.9.1
>            Reporter: Oleg Bevz
>            Priority: Critical
>             Fix For: 2.9.1
>
>
> Hello, current Apache Ignite does not support string comparison in LINQ provider (Apache.Ignite.Linq project).
> For example following modified query insideThinClientQueryExample.ScanQueryExample method will throw Exception:
> var employees = cache.AsCacheQueryable().Select(x => x.Value).Where(x => string.Compare(x.Name, "Daniel Adams") >= 0);
> Business case: in our projects we use DevExteme.AspNet.Data library to build LINQ queries for Apache Ignite and in some cases the library builds complex queries with string.Compare method call. 
> Exception details:
>  Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotSupportedException: Method not supported: System.String.(Int32 Compare(System.String, System.String))
>     at Apache.Ignite.Linq.Impl.MethodVisitor.VisitMethodCall(MethodCallExpression expression, CacheQueryExpressionVisitor visitor)
>     at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitMethodCall(MethodCallExpression expression)
>     at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
>     at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
>     at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
>     at Apache.Ignite.Linq.Impl.CacheQueryExpressionVisitor.VisitBinary(BinaryExpression expression)
>     at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)
>     at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitWhereClause(WhereClause whereClause, Int32 index, Boolean hasGroups)
>     at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.ProcessGroupings(QueryModel queryModel)
>     at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitBodyClauses(ObservableCollection`1 bodyClauses, QueryModel queryModel)
>     at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
>     at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.VisitQueryModel(QueryModel queryModel, Boolean includeAllFields, Boolean copyAliases)
>     at Apache.Ignite.Linq.Impl.CacheQueryModelVisitor.GenerateQuery(QueryModel queryModel)
>     at Apache.Ignite.Linq.Impl.CacheFieldsQueryExecutor.ExecuteCollection[T](QueryModel queryModel)
>     at Remotion.Linq.Clauses.StreamedData.StreamedSequenceInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
>     at Apache.Ignite.Linq.Impl.CacheFieldsQueryProvider.Execute[TResult](Expression expression)
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)