forked from dangtv/BIRDS
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ast2sqlでviewのΔに対してinsert/deleteを出力しない #49
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source a('A':int, 'B':int). | ||
source b('B':int, 'C':int). | ||
view v('A':int, 'B':int, 'C':int). | ||
-a(A, B) :- a(A, B) , not __updated__v(A, B, _). | ||
-b(B, C) :- a(GENV2, B) , b(B, C) , b(B, GENV3) , not -v(GENV2, B, GENV3) , not __updated__v(_, B, C). | ||
__updated__v(A, B, C) :- a(A, B) , b(B, C) , not -v(A, B, C). | ||
-v(GENV1, GENV2, GENV3) :- a(GENV1, GENV2) , b(GENV2, GENV3) , GENV2 = 30. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2505,6 +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 = 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) -> | ||
|
@@ -2559,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 TableSet.mem table existent_tables then | ||
if Option.fold ~none:true ~some:((<>) table) view_name && TableSet.mem table existent_tables then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. viewに対するΔ述語だったら除外 |
||
let update = | ||
match delta_kind with | ||
| Insert -> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option