diff --git a/lib/logical_plan.ml b/lib/logical_plan.ml index 3b485f4..36b5ec8 100644 --- a/lib/logical_plan.ml +++ b/lib/logical_plan.ml @@ -12,7 +12,7 @@ let rec ast_to_logical ast = and table_expression_to_logical table_exp = match table_exp with - | Ast.TableExpression(Some(tables), None, None) -> tables_to_logical tables + | Ast.TableExpression(tables, None, None) -> tables_to_logical tables | _ -> failwith "Table expression not supported yet" and columns_to_logical columns = @@ -29,10 +29,11 @@ and columns_to_logical columns = and expression_to_logical exp = match exp with | Ast.Ref(s) -> s + | Ast.StringLiteral(s) -> s | _ -> failwith "Expression not supported yet" and tables_to_logical tables = - let rec aux t = + let aux t = match t with | [] -> None | [Ast.Table(table_name)] -> Some(Scan(table_name)) @@ -43,7 +44,7 @@ and tables_to_logical tables = | Some(t) -> aux t -let rec pp_logical_plan plan = +let pp_logical_plan plan = match plan with - | Project(plan2, name) -> pp_logical_plan plan2 ^ (String.concat ";" name) + | Project(_, name) -> (String.concat ";" name) | _ -> "Not supported" diff --git a/test/test_logical_plan.ml b/test/test_logical_plan.ml index b38fb37..f2c4663 100644 --- a/test/test_logical_plan.ml +++ b/test/test_logical_plan.ml @@ -25,7 +25,7 @@ let test_simple_select () = in let plan1 = ast_to_logical ast1 in let plan2 = - Project(Scan("table"), ["string"]) + Project(None, ["string"]) in Alcotest.(check logical_plan_testable) "ok" plan1 plan2