diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-04-27 23:29:57 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-04-27 23:29:57 -0300 |
| commit | 4fdf3392868c72ff4c33b70d165a177e97f2fece (patch) | |
| tree | 4eebfc260c890ea56d59f874cdfa0c9b1f55cd98 /lib/drl/executor.ml | |
| parent | 97960adb8426e5270fe16b027e82a2c61674f821 (diff) | |
| download | Sakura-4fdf3392868c72ff4c33b70d165a177e97f2fece.tar.gz Sakura-4fdf3392868c72ff4c33b70d165a177e97f2fece.zip | |
Format
Diffstat (limited to 'lib/drl/executor.ml')
| -rw-r--r-- | lib/drl/executor.ml | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/drl/executor.ml b/lib/drl/executor.ml index 3ff4553..1172553 100644 --- a/lib/drl/executor.ml +++ b/lib/drl/executor.ml @@ -24,14 +24,15 @@ module Make (Storage : Management.Physical.S) = struct let common = List.filter_map (fun (n, _) -> - if List.exists (fun (m, _) -> m = n) filter.Relation.schema - then Some n + if List.exists (fun (m, _) -> m = n) filter.Relation.schema then + Some n else None) source.Relation.schema in let source_attrs = List.map fst source.Relation.schema in - Result.bind (wrap (Alg.equijoin storage common source filter)) (fun joined -> - wrap (Alg.project storage source_attrs joined)) + Result.bind + (wrap (Alg.equijoin storage common source filter)) + (fun joined -> wrap (Alg.project storage source_attrs joined)) let rec execute (storage : Storage.t) (db : Management.Database.t) (q : Ast.query) : (Relation.t, error) Result.t = @@ -54,26 +55,21 @@ module Make (Storage : Management.Physical.S) = struct execute storage db q2 >>= fun r2 -> wrap (Alg.equijoin storage attrs r1 r2) | Ast.Project (attrs, q) -> - execute storage db q >>= fun rel -> - wrap (Alg.project storage attrs rel) + execute storage db q >>= fun rel -> wrap (Alg.project storage attrs rel) | Ast.Rename (renames, q) -> execute storage db q >>= fun rel -> wrap (Alg.rename storage renames rel) | Ast.Cartesian (q1, q2) -> execute storage db q1 >>= fun r1 -> - execute storage db q2 >>= fun r2 -> - wrap (Alg.equijoin storage [] r1 r2) + execute storage db q2 >>= fun r2 -> wrap (Alg.equijoin storage [] r1 r2) | Ast.Union (q1, q2) -> execute storage db q1 >>= fun r1 -> - execute storage db q2 >>= fun r2 -> - wrap (Alg.union storage r1 r2) + execute storage db q2 >>= fun r2 -> wrap (Alg.union storage r1 r2) | Ast.Diff (q1, q2) -> execute storage db q1 >>= fun r1 -> - execute storage db q2 >>= fun r2 -> - wrap (Alg.diff storage r1 r2) + execute storage db q2 >>= fun r2 -> wrap (Alg.diff storage r1 r2) | Ast.Take (n, q) -> - execute storage db q >>= fun rel -> - wrap (Alg.take storage n rel) + execute storage db q >>= fun rel -> wrap (Alg.take storage n rel) end module Memory = Make (Management.Physical.Memory) |
