Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7889

.NET: linq GroupBy and Where do not work together

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.5
    • Component/s: platforms
    • Labels:

      Description

      The following code completely ignores the Where condition:

                      var groupByQuery2 = models.Where(m => m.Value.DateTicks < 10 && m.Value.Dirty.HasValue).GroupBy(m => m.Value.ContractId)
                          .Select(g => new KeyValuePair<string, int>(g.Key, g.Select(m => m.Value.Version).Min()));
      

      debugger shows SQL without WHERE:
      CacheQueryable [CacheName=someCache, TableName=MODEL, Query=SqlFieldsQuery [Sql=select _T0.CONTRACTID, min (_T0.VERSION) from "someCache".MODEL as _T0 group by (_T0.CONTRACTID), Arguments=[], Local=False, PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False, Timeout=00:00:00, ReplicatedOnly=False, Colocated=False, Schema=, Lazy=False]]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alexey.tank2 Alexey Popov
                Reporter:
                alexey.tank2 Alexey Popov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: