anchor.diff:  rewrite_start_key_with_filters([AddFieldName|Tail], ToKeyTypeFn, Filter, SKey, SInc1) when is_binary(AddFieldName) ->
       case proplists:get_value(AddFieldName, Filter) of
           {Op,_,_} = F  when Op == '='; Op == '>'; Op == '>=' ->
  -            %% when an equality operator is found, we can put it on the key but
  -            %% cannot safely remove the filter
               SKeyElem = to_key_elem(ToKeyTypeFn, F),
               %% if the quantum was inclusive, make sure we stay inclusive or
               %% the quantum boundary is modified later on
  
positive.code:         compile(DDL, Q)
      ).
  
  -endif.
  
negative.code: 
  rewrite_end_key_with_filters([], _, _, EKey, EInc) ->
      {EKey, EInc};
  rewrite_end_key_with_filters([AddFieldName|Tail], ToKeyTypeFn, Filter, EKey, EInc1) when is_binary(AddFieldName) ->
      case proplists:get_value(AddFieldName, Filter) of
          {Op,_,_} = F  when Op == '='; Op == '<' ->
              EKeyElem = to_key_elem(ToKeyTypeFn, F),
              %% if the quantum was inclusive, make sure we stay inclusive or
              %% the quantum boundary is modified later on
              EInc2 = ((EInc1 /= false) or is_inclusive_op(Op)),
              rewrite_end_key_with_filters(
                  Tail, ToKeyTypeFn, Filter, EKey++[EKeyElem], EInc2);
          _ ->
              %% there is no filter for the next additional field so give up! The
              %% filters must be consecutive, we can't have a '_' inbetween
              %% values
              {EKey, EInc1}
      end.
  
  is_inclusive_op('=')  -> true;
  is_inclusive_op('>')  -> false;
  is_inclusive_op('>=') -> true;
  is_inclusive_op('<') -> false;
  is_inclusive_op('=<') -> true.
  
  %% Convert a filter to a start/end key element
  to_key_elem(ToKeyTypeFn, {_,{field,FieldName,_},{_,Val}}) ->
  