anchor.diff:      #riak_field_v1{optional = Optional} = lists:keyfind(FieldName, #riak_field_v1.name, Fields),
       (Optional == true).
   
  +find_filter_check(FieldName, Acc) when is_binary(FieldName) ->
  +    case lists:keyfind(FieldName, #filtercheck.name, Acc) of
  +      false ->
  +          #filtercheck{name=FieldName};
  +      Val ->
  +          Val
  +    end.
   
   %% tl;dr put filters that test equality of columns in the local key but not in
   %% in the partition key, in the star and end key.
  
positive.code:         false ->
              throw({error, {impossible_where_clause, << >>}})
      end;
  check_where_clause_is_possible_fold(DDL, _Conditional, {'!=',{field,FieldName,_},{const,?SQL_NULL}} = F, Acc) ->
      %% `NOT NULL` filters
      %% if column is marked NOT NULL, and the WHERE clause has IS NOT NULL for
      %% that column then we can eliminate it, and reduce the filter, maybe to
  
negative.code:     {Field, FieldType, _OldVal} = lists:keyfind(Field, 1, TupleList),
      lists:keyreplace(Field, 1, TupleList, {Field, FieldType, NewVal}).
  
  -record(filtercheck, {name,'='}).
  
  check_where_clause_is_possible(DDL, WhereProps) ->
      Filter1 = proplists:get_value(filter, WhereProps),
      {Filter2, _} = riak_ql_ddl:mapfold_where_tree(
  