-
Notifications
You must be signed in to change notification settings - Fork 264
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
fix: insert and delete executor #611
Conversation
* fix to insert and delete executor * variable names * removing unnecessary arrays * use SQLalchemy for delete execution predicates * formatting * moving delete_predicate to expression_utils * formatting
@aryan-rajoria |
@aryan-rajoria I brought the PR up-to-date with master. Please pull in the latest changes. |
This delete statement does not work -- """DELETE FROM testDeleteOne WHERE id < 20 AND dummyfloat < 2;""" |
This is now resolved. All the tasks have been completed. |
eva/expression/expression_utils.py
Outdated
elif predicate_node.etype == ExpressionType.COMPARE_LEQ: | ||
filter_clause = x <= y | ||
elif predicate_node.etype == ExpressionType.COMPARE_NEQ: | ||
filter_clause = x != y |
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.
CONTAINS
and IS_CONTAINED
are not supported here. We can check and raise exception if they are non-trivial.
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.
Resolved.
eva/storage/sqlite_storage_engine.py
Outdated
|
||
filter_clause = predicate_node_to_filter_clause( | ||
table=table_to_delete_from, predicate_node=where_clause | ||
) |
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.
Nit: I feel it is better to move predicate_node_to_filter_clause
logic into delete_executor
and the delete_executor
accepts the ColumnElement[bool]
as the input argument (i.e., where_clause). ColumnElement[bool]
is the return type of and_
and or_
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.
Good idea. Moved it to delete_executor
Fixing issues in insert and delete executor based on feedback from @gaurav274
insert_executor
._roll_back
from the executors.delete_executor
using the SQLAlchemy.single_predicate_to_filter()
to ExpressionUtils.AND
andOR
)single_predicate()
.