anchor.diff:                 {'=', {field, <<"weather">>, varchar}, {const, <<"yankee">>}},
                  {'=', {field, <<"temperature">>, varchar}, {const, <<"yelp">>}}
                 }
  -             },
  -             {start_inclusive, false}
  +             }
               ],
  -    ?assertMatch(
  -       {ok, [?SQL_SELECT{ is_executable = true,
  -                          type          = timeseries,
  -                          'WHERE'       = Where,
  -                          partition_key = PK,
  -                          local_key     = LK }]},
  -       compile(DDL, Q, 5)
  -      ).
  +    {ok, [?SQL_SELECT{ 'WHERE'       = WhereVal,
  +                       partition_key = PK,
  +                       local_key     = LK }]} = compile(DDL, Q, 5),
  +    ?assertEqual(get_standard_pk(), PK),
  +    ?assertEqual(get_standard_lk(), LK),
  +    ?assertEqual(ExpectedWhere, WhereVal).
   
   complex_with_4_field_filter_test() ->
       Query = "select weather from GeoCheckin where time > 3000 and time < 5000 and user = 'user_1' and location = 'Scotland' and extra = 1 and (weather = 'yankee' or (temperature = 'yelp' and geohash = 'erko'))",
  
positive.code:     DDL = get_standard_ddl(),
      true = is_query_valid(DDL, Q),
      [[StartKey, EndKey |_]] =
          test_data_where_clause(<<"Scotland">>, <<"user_1">>, [{3000, 5000}]),
      PK = get_standard_pk(),
      LK = get_standard_lk(),
      Where = [
               StartKey,
               EndKey,
               {filter, {'=', {field, <<"weather">>, varchar}, {const, <<"yankee">>}}},
               {start_inclusive, false},
               {end_inclusive,   true}
              ],
      ?assertMatch(
         {ok, [?SQL_SELECT{ is_executable = true,
                            type          = timeseries,
                            'WHERE'       = Where,
                            partition_key = PK,
                            local_key     = LK }]},
         compile(DDL, Q, 5)
        ).
  
  simple_with_2_field_filter_test() ->
      {ok, Q} = get_query(
  
negative.code:                 "AND (myboolean = False OR myboolean = tRue)"),
      true = is_query_valid(DDL, Q),
      [[StartKey, EndKey |_]] =
          test_data_where_clause(<<"Scotland">>, <<"user_1">>, [{3001, 5000}]),
      ExpectedWhere = [
               StartKey,
               EndKey,
               {filter,
  