Skip to content

Commit

Permalink
viewがないDatalog式に対応
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshi-cl committed Sep 18, 2024
1 parent 9a4d524 commit 5d8b072
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ast2sql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,7 @@ let convert_expr_to_operation_based_sql (expr : expr) : (sql_operation list, err
table_env |> TableEnv.add table cols
) TableEnv.empty
in
let (view_name, _) = get_view expr in
let view_name = expr.view |> Option.map (fun (view_name, _) -> view_name) in
let existent_tables = table_env |> TableEnv.to_list |> List.map fst |> TableSet.of_list in
let rules = List.rev expr.rules in (* `expr` holds its rules in the reversed order *)
divide_rules_into_groups table_env rules >>= fun (rule_groups, table_env) ->
Expand Down Expand Up @@ -2560,7 +2560,7 @@ let convert_expr_to_operation_based_sql (expr : expr) : (sql_operation list, err
get_column_names_from_table ~error_detail:(InGroup delta_key) table_env table >>= fun cols ->
let delta_env = delta_env |> DeltaEnv.add delta_key (temporary_table, cols) in
let creation = SqlCreateTemporaryTable (temporary_table, sql_query) in
if table <> view_name && TableSet.mem table existent_tables then
if Option.fold ~none:true ~some:((<>) table) view_name && TableSet.mem table existent_tables then
let update =
match delta_kind with
| Insert ->
Expand Down

0 comments on commit 5d8b072

Please sign in to comment.