Skip to content
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

chore: Improving coverage #592

Merged
merged 96 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c9afc12
adding delete operation
aryan-rajoria Jan 22, 2023
34dfbf7
Adding Insert Statement
aryan-rajoria Jan 25, 2023
9fa9857
checkpoint
aryan-rajoria Jan 25, 2023
ebe26d3
supporting multiple entries
aryan-rajoria Jan 25, 2023
bc722dd
implemented for structured data error
aryan-rajoria Jan 25, 2023
0e29858
adding parser visitor for delete
aryan-rajoria Jan 25, 2023
c1a7864
delete executor
aryan-rajoria Jan 26, 2023
5ac631a
delete plan and rules
aryan-rajoria Jan 26, 2023
3238e95
adding delete to plan executor
aryan-rajoria Jan 26, 2023
02a1d28
change position of LogicalDelete
aryan-rajoria Jan 26, 2023
01181b5
logical delimeter
aryan-rajoria Jan 30, 2023
562a7ca
delete test case
aryan-rajoria Jan 30, 2023
9887732
adding test case
aryan-rajoria Feb 2, 2023
d2a1a3d
adding test case
aryan-rajoria Feb 2, 2023
f09c613
adding delete testcase
aryan-rajoria Feb 3, 2023
79a6168
adding predicate to delete executor
aryan-rajoria Feb 3, 2023
5ce1991
adding delete to Image storage
aryan-rajoria Feb 3, 2023
91d7b06
bug fix in delete
aryan-rajoria Feb 9, 2023
0aac934
fixing testcase
aryan-rajoria Feb 9, 2023
ee48803
adding test case for insert statement
aryan-rajoria Feb 9, 2023
fc2f243
remove order_by from statement_binder.py
aryan-rajoria Feb 9, 2023
343a4a2
better variable names, using Batch
aryan-rajoria Feb 9, 2023
121451f
error message for insert
aryan-rajoria Feb 9, 2023
5b47c15
removing order_by and limit from delete
aryan-rajoria Feb 10, 2023
8c75a5e
remove order_by and limit
aryan-rajoria Feb 10, 2023
6772cd0
use f-string
aryan-rajoria Feb 10, 2023
7a10d67
adding to changelog
aryan-rajoria Feb 10, 2023
1a4204f
removing commit messages
aryan-rajoria Feb 14, 2023
e96d3a4
formatting
aryan-rajoria Feb 14, 2023
640e7ed
fixing comments
aryan-rajoria Feb 14, 2023
cb50de3
formatting
aryan-rajoria Feb 14, 2023
533de9e
eva insert f32 values
aryan-rajoria Feb 15, 2023
e8081e4
Merge branch 'delete-operation' of github.com:Aryan-Rajoria/eva into …
jarulraj Feb 16, 2023
97bfac4
checkpoint
jarulraj Feb 16, 2023
0127ad0
checkpoint
jarulraj Feb 16, 2023
fc353c9
checkpoint
jarulraj Feb 16, 2023
10fd83a
checkpoint
jarulraj Feb 16, 2023
d559fe1
checkpoint
jarulraj Feb 16, 2023
445a710
checkpoint
jarulraj Feb 16, 2023
d246715
checkpoint
jarulraj Feb 16, 2023
17247fe
checkpoint
jarulraj Feb 16, 2023
8a2d5a3
fix: should delete range
aryan-rajoria Feb 16, 2023
365ae2f
delete multiple rows
aryan-rajoria Feb 16, 2023
88e74e3
udf bootstrap
aryan-rajoria Feb 16, 2023
0d4cde2
checkpoint
jarulraj Feb 16, 2023
a8918a7
checkpoint
jarulraj Feb 16, 2023
40bc613
checkpoint
jarulraj Feb 17, 2023
5a2faac
checkpoint
jarulraj Feb 17, 2023
5f4a802
checkpoint
jarulraj Feb 17, 2023
e952beb
checkpoint
jarulraj Feb 17, 2023
247b041
checkpoint
jarulraj Feb 17, 2023
08420d1
checkpoint
jarulraj Feb 17, 2023
536ae74
checkpoint
jarulraj Feb 17, 2023
d30fcbd
checkpoint
jarulraj Feb 17, 2023
31aa92d
checkpoint
jarulraj Feb 17, 2023
db930a4
checkpoint
jarulraj Feb 17, 2023
f76e856
checkpoint
jarulraj Feb 17, 2023
0ae4cd7
checkpoint
jarulraj Feb 17, 2023
c7c763e
checkpoint
jarulraj Feb 18, 2023
2711582
checkpoint
jarulraj Feb 18, 2023
86c0513
checkpoint
jarulraj Feb 18, 2023
4fcc190
checkpoint
jarulraj Feb 18, 2023
94d0ae0
checkpoint
jarulraj Feb 18, 2023
0701eb8
checkpoint
jarulraj Feb 18, 2023
b31ad91
checkpoint
jarulraj Feb 18, 2023
2bf76ff
checkpoint
jarulraj Feb 18, 2023
d72d778
checkpoint
jarulraj Feb 18, 2023
d74791c
checkpoint
jarulraj Feb 18, 2023
b783430
checkpoint
jarulraj Feb 18, 2023
2450485
checkpoint
jarulraj Feb 18, 2023
b78280e
checkpoint
jarulraj Feb 18, 2023
166aa32
checkpoint
jarulraj Feb 18, 2023
22d1386
Updated config.yml
jarulraj Feb 18, 2023
ba6bda9
checkpoint
jarulraj Feb 18, 2023
f9f4a2b
checkpoint
jarulraj Feb 18, 2023
429e513
checkpoint
jarulraj Feb 18, 2023
7e525a2
checkpoint
jarulraj Feb 18, 2023
1afe38a
checkpoint
jarulraj Feb 18, 2023
9744432
checkpoint
jarulraj Feb 18, 2023
cb859db
checkpoint
jarulraj Feb 19, 2023
acf36ce
checkpoint
jarulraj Feb 19, 2023
768a8a2
checkpoint
jarulraj Feb 19, 2023
32da4af
checkpoint
jarulraj Feb 19, 2023
13c7710
checkpoint
jarulraj Feb 19, 2023
ea2cee7
checkpoint
jarulraj Feb 19, 2023
eb56fcc
checkpoint
jarulraj Feb 19, 2023
ad339a6
checkpoint
jarulraj Feb 19, 2023
db1f388
checkpoint
jarulraj Feb 19, 2023
80bf59c
checkpoint
jarulraj Feb 19, 2023
a740112
checkpoint
jarulraj Feb 19, 2023
41c2051
checkpoint
jarulraj Feb 19, 2023
9fe2f81
checkpoint
jarulraj Feb 20, 2023
f37b92c
checkpoint
jarulraj Feb 20, 2023
46e2106
checkpoint
jarulraj Feb 20, 2023
35168e7
checkpoint
jarulraj Feb 20, 2023
e16eb3c
checkpoint
jarulraj Feb 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
checkpoint
  • Loading branch information
jarulraj committed Feb 19, 2023
commit ea2cee747821caa0381d1051cebf4267ce4afb72
23 changes: 2 additions & 21 deletions eva/optimizer/rules/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __init__(self):
def promise(self):
return Promise.EMBED_FILTER_INTO_DERIVED_GET

def check(self, before: Operator, context: OptimizerContext):
def check(self, before: LogicalFilter, context: OptimizerContext):
# nothing else to check if logical match found return true
return True

Expand All @@ -249,7 +249,7 @@ def __init__(self):
def promise(self):
return Promise.EMBED_PROJECT_INTO_DERIVED_GET

def check(self, before: Operator, context: OptimizerContext):
def check(self, before: LogicalProject, context: OptimizerContext):
# nothing else to check if logical match found return true
return True

Expand Down Expand Up @@ -778,25 +778,6 @@ def apply(self, before: LogicalGet, context: OptimizerContext):
yield after


class LogicalSampleToUniformSample(Rule):
def __init__(self):
pattern = Pattern(OperatorType.LOGICALSAMPLE)
pattern.append_child(Pattern(OperatorType.DUMMY))
super().__init__(RuleType.LOGICAL_SAMPLE_TO_UNIFORMSAMPLE, pattern)

def promise(self):
return Promise.LOGICAL_SAMPLE_TO_UNIFORMSAMPLE

def check(self, before: Operator, context: OptimizerContext):
return True

def apply(self, before: LogicalSample, context: OptimizerContext):
after = SamplePlan(before.sample_freq)
for child in before.children:
after.append_child(child)
yield after


class LogicalDerivedGetToPhysical(Rule):
def __init__(self):
pattern = Pattern(OperatorType.LOGICALQUERYDERIVEDGET)
Expand Down
2 changes: 0 additions & 2 deletions eva/optimizer/rules/rules_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
)
from eva.optimizer.rules.rules import (
LogicalRenameToPhysical,
LogicalSampleToUniformSample,
LogicalShowToPhysical,
LogicalUnionToPhysical,
LogicalUploadToPhysical,
Expand Down Expand Up @@ -101,7 +100,6 @@ def __init__(self):
LogicalDeleteToPhysical(),
LogicalLoadToPhysical(),
LogicalUploadToPhysical(),
LogicalSampleToUniformSample(),
DistributedLogicalGetToSeqScan()
if ray_enabled
else SequentialLogicalGetToSeqScan(),
Expand Down
2 changes: 2 additions & 0 deletions test/integration_tests/test_optimizer_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def test_should_benefit_from_pushdown(self, evaluate_mock):

self.assertEqual(result_without_xform_rule, result_with_rule)



def test_should_support_pushdown_with_right_join(self):
query = """SELECT A.id FROM MyVideo AS A JOIN MyVideo AS B
WHERE A.id = B.id AND B.id < 10"""
Expand Down
18 changes: 11 additions & 7 deletions test/optimizer/rules/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
LogicalProject,
LogicalQueryDerivedGet,
LogicalSample,
LogicalJoin
)
from eva.optimizer.rules.rules import (
CombineSimilarityOrderByAndLimitToFaissIndexScan,
Expand Down Expand Up @@ -60,7 +61,6 @@
LogicalOrderByToPhysical,
LogicalProjectToPhysical,
LogicalRenameToPhysical,
LogicalSampleToUniformSample,
LogicalShowToPhysical,
LogicalUnionToPhysical,
LogicalUploadToPhysical,
Expand All @@ -71,7 +71,7 @@
)
from eva.optimizer.rules.rules_manager import RulesManager
from eva.server.command_handler import execute_query_fetch_all

from eva.parser.types import JoinType

class RulesTest(unittest.TestCase):
@classmethod
Expand Down Expand Up @@ -189,7 +189,6 @@ def test_supported_rules(self):
LogicalDeleteToPhysical(),
LogicalLoadToPhysical(),
LogicalUploadToPhysical(),
LogicalSampleToUniformSample(),
LogicalGetToSeqScan(),
LogicalDerivedGetToPhysical(),
LogicalUnionToPhysical(),
Expand Down Expand Up @@ -251,26 +250,26 @@ def test_simple_filter_into_get(self):
self.assertFalse(rewrite_opr is logi_get)
self.assertEqual(rewrite_opr.predicate, predicate)

# EmbedFilterIntoDerivedGet
def test_simple_filter_into_derived_get(self):
def test_embed_filter_into_derived_get(self):
rule = EmbedFilterIntoDerivedGet()
predicate = MagicMock()

logi_derived_get = LogicalQueryDerivedGet(MagicMock())
logi_filter = LogicalFilter(predicate, [logi_derived_get])

self.assertTrue(rule.check(logi_derived_get, MagicMock()))
rewrite_opr = next(rule.apply(logi_filter, MagicMock()))
self.assertFalse(rewrite_opr is logi_derived_get)
self.assertEqual(rewrite_opr.predicate, predicate)

# EmbedProjectIntoDerivedGet
def test_simple_project_into_derived_get(self):
def test_embed_project_into_derived_get(self):
rule = EmbedProjectIntoDerivedGet()
target_list = MagicMock()

logi_derived_get = LogicalQueryDerivedGet(MagicMock())
logi_project = LogicalProject(target_list, [logi_derived_get])

self.assertTrue(rule.check(logi_derived_get, MagicMock()))
rewrite_opr = next(rule.apply(logi_project, MagicMock()))
self.assertFalse(rewrite_opr is logi_derived_get)
self.assertEqual(rewrite_opr.target_list, target_list)
Expand All @@ -286,3 +285,8 @@ def test_embed_sample_into_get_does_not_work_with_structured_data(self):
logi_sample = LogicalSample(MagicMock(), children=[logi_get])

self.assertFalse(rule.check(logi_sample, MagicMock()))

def test_xform_lateral_join_does_not_work_with_other_join(self):
rule = XformLateralJoinToLinearFlow()
logi_join = LogicalJoin(JoinType.INNER_JOIN)
self.assertFalse(rule.check(logi_join, MagicMock()))