aboutsummaryrefslogtreecommitdiffstats
path: root/lib/planner.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2024-12-08 15:00:31 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2024-12-08 15:00:31 -0300
commitc67ed574a7a95db73d9349d58727452850bd47b9 (patch)
tree8bc1c0e98b72ead8bf0ba71fe0ffeccbff7c9fd5 /lib/planner.ml
parent75f1ff70f92b9b7e7c72580ce210b5c7622918bf (diff)
downloadSakura-c67ed574a7a95db73d9349d58727452850bd47b9.tar.gz
Sakura-c67ed574a7a95db73d9349d58727452850bd47b9.zip
planner seq scan assuming ordering of results
Diffstat (limited to 'lib/planner.ml')
-rw-r--r--lib/planner.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/planner.ml b/lib/planner.ml
index ceaf815..b88090d 100644
--- a/lib/planner.ml
+++ b/lib/planner.ml
@@ -1,7 +1,17 @@
module Scan = struct
open Disk
let execute commit locations (entity: string) =
- Executor.read commit locations ~filename:entity
+ let binary = Executor.read commit locations ~filename:("schema~" ^ entity) in
+ let relation =
+ Result.map_error (fun _ -> "Failed to deserialize relation from binary format.")
+ @@ Data_encoding.Binary.of_bytes Schema.Protocol.relation_encoding (Bytes.concat Bytes.empty binary) in
+ match relation with
+ | Ok relation ->
+ begin
+ let attrs = List.map (fun (a: Schema.Protocol.attribute) -> relation.name ^ "/" ^ a.name) relation.attributes in
+ Executor.read commit locations ~filename:("schema~" ^ entity)
+ end
+ | Error err -> failwith err
end
module Join = struct