reparing test_logical_plan
This commit is contained in:
parent
93970e6ddc
commit
717aac2c2d
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user