ocaml_sql_parser/lib/logical_plan.ml
2024-12-13 14:05:36 +00:00

18 lines
493 B
OCaml

type logical_plan =
| Project of logical_plan * string
| Scan of string (* Table name *)
| Filter of logical_plan
| Join of logical_plan * Ast.join_type * logical_plan
| Group of logical_plan * string list
let ast_to_logical ast =
match ast with
| Ast.Select(_, _) -> Project(Scan("table"), "ok")
| _ -> failwith "Query not supported yet"
let rec pp_logical_plan plan =
match plan with
| Project(plan2, name) -> pp_logical_plan plan2 ^ name
| _ -> "Not supported"