anchor.diff:                       Options) ->
       try
           {W2,_} = resolve_expressions(Mod, Options, W1),
  -        case {check_if_timeseries(DDL, lists:flatten([W2])), unwrap_cover(Cover)} of
  +        {W3,OrFilters} = hoist_partition_key_equality_filters([<<"a">>], W2),
  +        %% Now that the equality filters under OR for parition key fileds has been
  +        %% filtered out, we put a dummy value in there, so that the rest of the type
  +        %% checking passes
  +        %?debugFmt(">>> WHERE ~w ORFILTERS ~w",[Where2,OrFilters]),
  +        W4 = lists:foldl(
  +            fun({FieldName,_},Acc) ->
  +                case Acc of
  +                    [] -> {'=',FieldName,{sint64,80085}};
  +                    _  -> {and_,{'=',FieldName,{sint64,80085}},Acc}
  +                end
  +            end, W3, OrFilters),
  +        case {check_if_timeseries(DDL, lists:flatten([W4])), unwrap_cover(Cover)} of
               {{error, E}, _} ->
                   {error, E};
               {_, {error, E}} ->
                   {error, E};
  -            {{true, W3}, {ok, {RealCover, WhereModifications}}} ->
  -                expand_query(DDL, Q?SQL_SELECT{cover_context = RealCover},
  -                             update_where_for_cover(W3, WhereModifications))
  +            {{true, W5}, {ok, {RealCover, WhereModifications}}} ->
  +                expand_query(DDL, OrFilters, Q?SQL_SELECT{cover_context = RealCover},
  +                             update_where_for_cover(W5, WhereModifications))
           end
       catch
           throw:Error when element(1,Error) == error -> Error
       end.
   
   %% now break out the query on quantum boundaries
  --spec expand_query(?DDL{}, ?SQL_SELECT{}, proplists:proplist()) ->
  +-spec expand_query(?DDL{}, list(), ?SQL_SELECT{}, proplists:proplist()) ->
                             {ok, [?SQL_SELECT{}]} | {error, term()}.
  -expand_query(?DDL{local_key = LK, partition_key = PK},
  +expand_query(?DDL{local_key = LK, partition_key = PK}, OrFilters,
                ?SQL_SELECT{helper_mod = Mod} = Q1, Where1) ->
       case expand_where(Where1, PK) of
           {error, E} ->
  
positive.code:         is_query_valid(DDL, Q)
      ).
  
  -endif.
  
negative.code:                        'WHERE'       = maybe_fix_start_order(IsDescending, X),
                         local_key     = LK,
                         partition_key = PK} || X <- Where2],
              SubQueries2 = expand_sub_queries(OrFilters, SubQueries1),
              SubQueries3 =
                  case IsDescending of
                      true ->
                          fix_subquery_order(SubQueries2);
                      false ->
                          SubQueries2
                  end,
              {ok, SubQueries3}
      end.
  
  expand_sub_queries([], SubQueries) ->
      SubQueries;
  expand_sub_queries(OrFilters, SubQueries) ->
      [modify_sub_query_where_range_keys(F,Q) || Q <- SubQueries, {_, Filters} <- OrFilters, F <- Filters].
  
  modify_sub_query_where_range_keys({'=',FieldName,{_,Value}},?SQL_SELECT{'WHERE' = Where1} = Q) ->
      SKey1 = modify_where_key(proplists:get_value(startkey, Where1), FieldName, Value),
      EKey1 = modify_where_key(proplists:get_value(endkey, Where1), FieldName, Value),
      Where2 = lists:keystore(startkey,1,Where1,{startkey,SKey1}),
      Where3 = lists:keystore(endkey,1,Where2,  {endkey,EKey1}),
      Q?SQL_SELECT{'WHERE' = Where3}.
  
  %% Only check the last column in the partition key, otherwise the start/end key
  %% does not need to be flipped. The data is not stored in a different order to
  