Commits

Kota UENISHI committed 4cbcaf7

work

Comments (0)

Files changed (1)

 
   print_endline " => test ok";;
 
+(* DO OPTIMIZATION HERE *)
+(* plan the query here *)
 let rec eval_pairs cond = function
   | [] -> false;
   | (k,Json.Number(Json.Int(v)))::tl ->
     end
   | _::tl -> eval_pairs cond tl;;
 
-
+(* plan the query here *)
 let rec eval_cond pairs = function
   | Sql.And(c0, c1) -> (eval_cond pairs c0) && (eval_cond pairs c1);
   | Sql.Or(c0, c1)  -> (eval_cond pairs c0) || (eval_cond pairs c1);
   | Sql.Not(c)      -> not (eval_cond pairs c);
   | c -> eval_pairs c pairs;;
 
+(* plan the query here *)
 let eval_conds conds = function
   | Json.Object(pairs) ->
     List.for_all (eval_cond pairs) conds;
   | _ -> false;;
 
+(* plan the query here *)
 let rec get_col col = function
   | [] -> Json.Null;
   | (k,v)::_ when k=col -> v;