From 0703cc4740ac2676321481e4a1af4572600c66d9 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Mon, 18 Sep 2023 11:42:34 -0400 Subject: [PATCH 01/11] Adding SET statement to parser modified: evadb/parser/evadb.lark --- evadb/parser/evadb.lark | 2 ++ 1 file changed, 2 insertions(+) diff --git a/evadb/parser/evadb.lark b/evadb/parser/evadb.lark index 716fd28a3f..a3b76d29c8 100644 --- a/evadb/parser/evadb.lark +++ b/evadb/parser/evadb.lark @@ -79,6 +79,8 @@ drop_table: DROP TABLE if_exists? uid drop_function: DROP FUNCTION if_exists? uid +// SET statements (configuration) +set_statement: SET uid EQUAL_SYMBOL (string_literal | decimal_literal | boolean_literal) // Data Manipulation Language From d1a092b9d38492f3221322066ad308baa5521f66 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Wed, 20 Sep 2023 20:47:59 -0400 Subject: [PATCH 02/11] Added parser for set_statement modified: evadb/parser/evadb.lark Added class for set_statement new file: evadb/parser/set_statement.py Added SET to statement_types modified: evadb/parser/types.py --- evadb/parser/evadb.lark | 4 +-- evadb/parser/set_statement.py | 48 +++++++++++++++++++++++++++++++++++ evadb/parser/types.py | 1 + 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 evadb/parser/set_statement.py diff --git a/evadb/parser/evadb.lark b/evadb/parser/evadb.lark index a3b76d29c8..d14c853cf6 100644 --- a/evadb/parser/evadb.lark +++ b/evadb/parser/evadb.lark @@ -8,7 +8,7 @@ ddl_statement: create_database | create_table | create_index | create_function | drop_database | drop_table | drop_function | drop_index | rename_table dml_statement: select_statement | insert_statement | update_statement - | delete_statement | load_statement + | delete_statement | load_statement | set_statement utility_statement: describe_statement | show_statement | help_statement | explain_statement @@ -80,7 +80,7 @@ drop_table: DROP TABLE if_exists? uid drop_function: DROP FUNCTION if_exists? uid // SET statements (configuration) -set_statement: SET uid EQUAL_SYMBOL (string_literal | decimal_literal | boolean_literal) +set_statement: SET uid EQUAL_SYMBOL (string_literal | decimal_literal | boolean_literal | real_literal) // Data Manipulation Language diff --git a/evadb/parser/set_statement.py b/evadb/parser/set_statement.py new file mode 100644 index 0000000000..2120abfee4 --- /dev/null +++ b/evadb/parser/set_statement.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# Copyright 2018-2023 EvaDB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from __future__ import annotations +from typing import Union + +from evadb.parser.statement import AbstractStatement +from evadb.parser.types import StatementType + + +class SetStatement(AbstractStatement): + def __init__(self, config_name: str, config_value: Union[int, str, float]): + super().__init__(StatementType.SET) + self.config_name = config_name + self.config_value = config_value + + @property + def config_name(self): + return self.config_name + + @property + def config_value(self): + return self.config_value + + def __str__(self): + return f"SET {str(self.config_name)} = {str(self.config_value)}" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, SetStatement): + return False + return ( + self.config_name == other.config_name + and self.config_value == other.config_value + ) + + def __hash__(self) -> int: + return hash((super().__hash__(), self.config_name, self.config_value)) diff --git a/evadb/parser/types.py b/evadb/parser/types.py index a57c938db8..14011f1745 100644 --- a/evadb/parser/types.py +++ b/evadb/parser/types.py @@ -41,6 +41,7 @@ class StatementType(EvaDBEnum): CREATE_INDEX # noqa: F821 CREATE_DATABASE # noqa: F821 USE # noqa: F821 + SET # noqa: F821 # add other types From bf5c30af6952abc44221353fd079596e6f822d42 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Wed, 20 Sep 2023 21:05:31 -0400 Subject: [PATCH 03/11] Added lark interpreter and added config_name and config_value to lark statement modified: evadb/parser/evadb.lark modified: evadb/parser/lark_visitor/__init__.py new file: evadb/parser/lark_visitor/_set_statement.py --- evadb/parser/evadb.lark | 6 +++- evadb/parser/lark_visitor/__init__.py | 1 + evadb/parser/lark_visitor/_set_statement.py | 35 +++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 evadb/parser/lark_visitor/_set_statement.py diff --git a/evadb/parser/evadb.lark b/evadb/parser/evadb.lark index 1ffa4261f4..596f736baa 100644 --- a/evadb/parser/evadb.lark +++ b/evadb/parser/evadb.lark @@ -80,7 +80,11 @@ drop_table: DROP TABLE if_exists? uid drop_function: DROP FUNCTION if_exists? uid // SET statements (configuration) -set_statement: SET uid EQUAL_SYMBOL (string_literal | decimal_literal | boolean_literal | real_literal) +set_statement: SET config_name EQUAL_SYMBOL config_value + +config_name: uid + +config_value: (string_literal | decimal_literal | boolean_literal | real_literal) // Data Manipulation Language diff --git a/evadb/parser/lark_visitor/__init__.py b/evadb/parser/lark_visitor/__init__.py index 220f2a6d50..0a8347510d 100644 --- a/evadb/parser/lark_visitor/__init__.py +++ b/evadb/parser/lark_visitor/__init__.py @@ -72,6 +72,7 @@ class LarkInterpreter( Explain, Delete, Use, + Set, ): def __init__(self, query): super().__init__() diff --git a/evadb/parser/lark_visitor/_set_statement.py b/evadb/parser/lark_visitor/_set_statement.py new file mode 100644 index 0000000000..9fc8ffe480 --- /dev/null +++ b/evadb/parser/lark_visitor/_set_statement.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# Copyright 2018-2023 EvaDB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from lark.tree import Tree + +from evadb.parser.set_statement import SetStatement + + +################################################################## +# DELETE STATEMENTS +################################################################## +class Set: + def set_statement(self, tree): + config_name = None + config_value = None + for child in tree.children: + if isinstance(child, Tree): + if child.data == "config_name": + config_name = self.visit(child) + elif child.data == "config_value": + config_value = self.visit(child) + + set_stmt = SetStatement(config_name, config_value) + return set_stmt From 64db60af111840fe809e44dc92f1a993ee1bccdc Mon Sep 17 00:00:00 2001 From: hershd23 Date: Wed, 20 Sep 2023 22:51:12 -0400 Subject: [PATCH 04/11] Added an executor for set queries modified: evadb/executor/plan_executor.py new file: evadb/executor/set_executor.py Added an optimizer for set queries modified: evadb/optimizer/operators.py modified: evadb/optimizer/statement_to_opr_converter.py Added a plan for set queries new file: evadb/plan_nodes/set_plan.py modified: evadb/plan_nodes/types.py --- evadb/executor/plan_executor.py | 2 + evadb/executor/set_executor.py | 31 ++++++++++++ evadb/optimizer/operators.py | 50 ++++++++++++++++++- evadb/optimizer/statement_to_opr_converter.py | 8 +++ evadb/plan_nodes/set_plan.py | 41 +++++++++++++++ evadb/plan_nodes/types.py | 1 + 6 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 evadb/executor/set_executor.py create mode 100644 evadb/plan_nodes/set_plan.py diff --git a/evadb/executor/plan_executor.py b/evadb/executor/plan_executor.py index 8c7a8b47b7..b1bf186de3 100644 --- a/evadb/executor/plan_executor.py +++ b/evadb/executor/plan_executor.py @@ -156,6 +156,8 @@ def _build_execution_tree( executor_node = VectorIndexScanExecutor(db=self._db, node=plan) elif plan_opr_type == PlanOprType.DELETE: executor_node = DeleteExecutor(db=self._db, node=plan) + elif plan_opr_type == PlanOprType.SET: + executor_node = SetExecutor(db=self._db, node=plan) # EXPLAIN does not need to build execution tree for its children if plan_opr_type != PlanOprType.EXPLAIN: diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py new file mode 100644 index 0000000000..649c8e5e76 --- /dev/null +++ b/evadb/executor/set_executor.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# Copyright 2018-2023 EvaDB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pandas as pd + +from evadb.database import EvaDBDatabase +from evadb.executor.abstract_executor import AbstractExecutor +from evadb.plan_nodes.set_plan import SetPlan + + +class SetExecutor(AbstractExecutor): + def __init__(self, db: EvaDBDatabase, node: SetPlan): + super().__init__(db, node) + + def exec(self, *args, **kwargs): + # Get method implementation from the config.update_value + self._config.update_value( + category="default", key=SetPlan.config_name, value=SetPlan.config_value + ) + pass diff --git a/evadb/optimizer/operators.py b/evadb/optimizer/operators.py index cc9346409e..334b6306dc 100644 --- a/evadb/optimizer/operators.py +++ b/evadb/optimizer/operators.py @@ -15,7 +15,7 @@ from collections import deque from enum import IntEnum, auto from pathlib import Path -from typing import Any, List +from typing import Any, List, Union from evadb.catalog.catalog_type import VectorStoreType from evadb.catalog.models.column_catalog import ColumnCatalogEntry @@ -64,6 +64,7 @@ class OperatorType(IntEnum): LOGICAL_VECTOR_INDEX_SCAN = auto() LOGICAL_USE = auto() LOGICALDELIMITER = auto() + LOGICALSET = auto() class Operator: @@ -1257,3 +1258,50 @@ def __hash__(self) -> int: self.search_query_expr, ) ) + + +class LogicalSet(Operator): + """[Logical Node for Set Operation] + + Arguments: + config_name(str): table to delete tuples from, + config_value(Union(int, float, str)): the predicate used to select which rows to delete, + + """ + + def __init__( + self, + config_name: str, + config_value: Union(int, float, str), + children=None, + ): + super().__init__(OperatorType.LOGICALSET, children) + self.config_name = config_name + self.config_value = config_value + + @property + def config_name(self): + return self.config_name + + @property + def config_value(self): + return self.config_value + + def __eq__(self, other): + is_subtree_equal = super().__eq__(other) + if not isinstance(other, LogicalSet): + return False + return ( + is_subtree_equal + and self.config_name == other.config_name + and self.config_value == other.config_value + ) + + def __hash__(self) -> int: + return hash( + ( + super().__hash__(), + self.config_name, + self.config_value, + ) + ) diff --git a/evadb/optimizer/statement_to_opr_converter.py b/evadb/optimizer/statement_to_opr_converter.py index d0e36e16a3..8242f59c55 100644 --- a/evadb/optimizer/statement_to_opr_converter.py +++ b/evadb/optimizer/statement_to_opr_converter.py @@ -38,6 +38,7 @@ LogicalSample, LogicalShow, LogicalUnion, + LogicalSet, ) from evadb.optimizer.optimizer_utils import ( column_definition_to_function_io, @@ -54,6 +55,7 @@ from evadb.parser.rename_statement import RenameTableStatement from evadb.parser.select_statement import SelectStatement from evadb.parser.show_statement import ShowStatement +from evadb.parser.set_statement import SetStatement from evadb.parser.statement import AbstractStatement from evadb.parser.table_ref import JoinNode, TableRef, TableValuedExpression from evadb.parser.types import FunctionType, JoinType @@ -370,6 +372,10 @@ def visit_delete(self, statement: DeleteTableStatement): ) self._plan = delete_opr + def visit_set(self, statement: SetStatement): + set_opr = LogicalSet(statement.config_name, statement.config_value) + self.plan = set_opr + def visit(self, statement: AbstractStatement): """Based on the instance of the statement the corresponding visit is called. @@ -400,6 +406,8 @@ def visit(self, statement: AbstractStatement): self.visit_create_index(statement) elif isinstance(statement, DeleteTableStatement): self.visit_delete(statement) + elif isinstance(statement, SetStatement): + self.visit_set(statement) return self._plan @property diff --git a/evadb/plan_nodes/set_plan.py b/evadb/plan_nodes/set_plan.py new file mode 100644 index 0000000000..237ad4fdf0 --- /dev/null +++ b/evadb/plan_nodes/set_plan.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# Copyright 2018-2023 EvaDB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from typing import Union +from evadb.plan_nodes.abstract_plan import AbstractPlan +from evadb.plan_nodes.types import PlanOprType + + +class SetPlan(AbstractPlan): + def __init__(self, config_name: str, config_value: Union(int, float, str)): + self.config_name = config_name + self.config_value = config_value + super().__init__(PlanOprType.SET) + + @property + def config_name(self): + return self.config_name + + @property + def config_value(self): + return self.config_value + + def __str__(self): + return "SetPlan(config_name={}, \ + config_value={})".format( + self.config_name, self.config_value + ) + + def __hash__(self) -> int: + return hash((super().__hash__(), self.config_name, self.config_value)) diff --git a/evadb/plan_nodes/types.py b/evadb/plan_nodes/types.py index 7b989e8e89..7ccf95e6ac 100644 --- a/evadb/plan_nodes/types.py +++ b/evadb/plan_nodes/types.py @@ -48,4 +48,5 @@ class PlanOprType(Enum): VECTOR_INDEX_SCAN = auto() NATIVE = auto() SQLALCHEMY = auto() + SET = auto() # add other types From 4653edb55b9cd0d26567ba7578b73705c3ff09e9 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Wed, 20 Sep 2023 23:34:17 -0400 Subject: [PATCH 05/11] Fixed unit and short integration tests --- evadb/optimizer/operators.py | 17 ++++++++--------- evadb/parser/lark_visitor/__init__.py | 1 + evadb/parser/set_statement.py | 4 ++-- evadb/plan_nodes/set_plan.py | 4 ++-- .../test_statement_to_opr_converter.py | 4 ++++ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/evadb/optimizer/operators.py b/evadb/optimizer/operators.py index 334b6306dc..7501a57c43 100644 --- a/evadb/optimizer/operators.py +++ b/evadb/optimizer/operators.py @@ -15,7 +15,7 @@ from collections import deque from enum import IntEnum, auto from pathlib import Path -from typing import Any, List, Union +from typing import Any, List from evadb.catalog.catalog_type import VectorStoreType from evadb.catalog.models.column_catalog import ColumnCatalogEntry @@ -1264,28 +1264,27 @@ class LogicalSet(Operator): """[Logical Node for Set Operation] Arguments: - config_name(str): table to delete tuples from, - config_value(Union(int, float, str)): the predicate used to select which rows to delete, - + config_name(str): The config_name to add, + config_value(Any): The config_value to add, """ def __init__( self, config_name: str, - config_value: Union(int, float, str), + config_value: Any, children=None, ): super().__init__(OperatorType.LOGICALSET, children) - self.config_name = config_name - self.config_value = config_value + self._config_name = config_name + self._config_value = config_value @property def config_name(self): - return self.config_name + return self._config_name @property def config_value(self): - return self.config_value + return self._config_value def __eq__(self, other): is_subtree_equal = super().__eq__(other) diff --git a/evadb/parser/lark_visitor/__init__.py b/evadb/parser/lark_visitor/__init__.py index 0a8347510d..dcbc021452 100644 --- a/evadb/parser/lark_visitor/__init__.py +++ b/evadb/parser/lark_visitor/__init__.py @@ -30,6 +30,7 @@ from evadb.parser.lark_visitor._show_statements import Show from evadb.parser.lark_visitor._table_sources import TableSources from evadb.parser.lark_visitor._use_statement import Use +from evadb.parser.lark_visitor._set_statement import Set # To add new functionality to the parser, create a new file under # the lark_visitor directory, and implement a new class which diff --git a/evadb/parser/set_statement.py b/evadb/parser/set_statement.py index 2120abfee4..ff2defe536 100644 --- a/evadb/parser/set_statement.py +++ b/evadb/parser/set_statement.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import annotations -from typing import Union +from typing import Any from evadb.parser.statement import AbstractStatement from evadb.parser.types import StatementType class SetStatement(AbstractStatement): - def __init__(self, config_name: str, config_value: Union[int, str, float]): + def __init__(self, config_name: str, config_value: Any): super().__init__(StatementType.SET) self.config_name = config_name self.config_value = config_value diff --git a/evadb/plan_nodes/set_plan.py b/evadb/plan_nodes/set_plan.py index 237ad4fdf0..ce0758444e 100644 --- a/evadb/plan_nodes/set_plan.py +++ b/evadb/plan_nodes/set_plan.py @@ -12,13 +12,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Union +from typing import Any from evadb.plan_nodes.abstract_plan import AbstractPlan from evadb.plan_nodes.types import PlanOprType class SetPlan(AbstractPlan): - def __init__(self, config_name: str, config_value: Union(int, float, str)): + def __init__(self, config_name: str, config_value: Any): self.config_name = config_name self.config_value = config_value super().__init__(PlanOprType.SET) diff --git a/test/unit_tests/optimizer/test_statement_to_opr_converter.py b/test/unit_tests/optimizer/test_statement_to_opr_converter.py index ef93fe3ec9..7936d14b3c 100644 --- a/test/unit_tests/optimizer/test_statement_to_opr_converter.py +++ b/test/unit_tests/optimizer/test_statement_to_opr_converter.py @@ -42,6 +42,7 @@ LogicalQueryDerivedGet, LogicalRename, LogicalSample, + LogicalSet, LogicalShow, LogicalUnion, LogicalVectorIndexScan, @@ -281,6 +282,7 @@ def test_inequality_in_operator(self): def test_check_plan_equality(self): plans = [] dummy_plan = Dummy(MagicMock(), MagicMock()) + set_plan = LogicalSet(MagicMock(), MagicMock()) create_plan = LogicalCreate(MagicMock(), MagicMock()) create_function_plan = LogicalCreateFunction( MagicMock(), MagicMock(), MagicMock(), MagicMock(), MagicMock(), MagicMock() @@ -317,6 +319,7 @@ def test_check_plan_equality(self): extract_object_plan = LogicalExtractObject( MagicMock(), MagicMock(), MagicMock(), MagicMock() ) + create_plan.append_child(create_function_plan) plans.append(dummy_plan) @@ -345,6 +348,7 @@ def test_check_plan_equality(self): plans.append(faiss_plan) plans.append(project_plan) plans.append(extract_object_plan) + plans.append(set_plan) derived_operators = list(get_all_subclasses(Operator)) From 12f35038149848e7c081119e28c25b83fb2bf59b Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 10:44:55 -0400 Subject: [PATCH 06/11] Added a NOTE for Set Executor modified: evadb/executor/set_executor.py Since we use a comparitor in the LOGICAL OPERTATORS on LOGICAL DELIMITER, we have to put LOGICALSET over LOGICALDELIMITER modified: evadb/optimizer/operators.py Fixed typo (private data member) modified: evadb/optimizer/statement_to_opr_converter.py Added a construct for TO modified: evadb/parser/evadb.lark Make class variables as properties modified: evadb/parser/set_statement.py Added a short integration test for end to end query testing new file: test/integration_tests/short/test_set_executor.py Added a unit test for SET query parsing modified: test/unit_tests/parser/test_parser.py --- evadb/executor/set_executor.py | 14 ++++++- evadb/optimizer/operators.py | 2 +- evadb/optimizer/statement_to_opr_converter.py | 2 +- evadb/parser/evadb.lark | 2 +- evadb/parser/set_statement.py | 8 ++-- .../short/test_set_executor.py | 41 +++++++++++++++++++ test/unit_tests/parser/test_parser.py | 16 ++++++++ 7 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 test/integration_tests/short/test_set_executor.py diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py index 649c8e5e76..ce3fee2727 100644 --- a/evadb/executor/set_executor.py +++ b/evadb/executor/set_executor.py @@ -25,7 +25,19 @@ def __init__(self, db: EvaDBDatabase, node: SetPlan): def exec(self, *args, **kwargs): # Get method implementation from the config.update_value + """ + NOTE :- Currently adding adding all configs in 'default' category. + The idea is to deprecate category to maintain the same format for + the query as DuckDB and Postgres + + Ref :- + https://www.postgresql.org/docs/7.0/sql-set.htm + https://duckdb.org/docs/sql/configuration.html + + This design change for configuation manager will be taken care of + as a separate PR for the issue #1140, where all instances of config use + will be replaced + """ self._config.update_value( category="default", key=SetPlan.config_name, value=SetPlan.config_value ) - pass diff --git a/evadb/optimizer/operators.py b/evadb/optimizer/operators.py index 7501a57c43..5ba58cd458 100644 --- a/evadb/optimizer/operators.py +++ b/evadb/optimizer/operators.py @@ -63,8 +63,8 @@ class OperatorType(IntEnum): LOGICAL_EXTRACT_OBJECT = auto() LOGICAL_VECTOR_INDEX_SCAN = auto() LOGICAL_USE = auto() - LOGICALDELIMITER = auto() LOGICALSET = auto() + LOGICALDELIMITER = auto() class Operator: diff --git a/evadb/optimizer/statement_to_opr_converter.py b/evadb/optimizer/statement_to_opr_converter.py index 8242f59c55..7e8c52eda0 100644 --- a/evadb/optimizer/statement_to_opr_converter.py +++ b/evadb/optimizer/statement_to_opr_converter.py @@ -374,7 +374,7 @@ def visit_delete(self, statement: DeleteTableStatement): def visit_set(self, statement: SetStatement): set_opr = LogicalSet(statement.config_name, statement.config_value) - self.plan = set_opr + self._plan = set_opr def visit(self, statement: AbstractStatement): """Based on the instance of the statement the corresponding diff --git a/evadb/parser/evadb.lark b/evadb/parser/evadb.lark index 596f736baa..6785b78119 100644 --- a/evadb/parser/evadb.lark +++ b/evadb/parser/evadb.lark @@ -80,7 +80,7 @@ drop_table: DROP TABLE if_exists? uid drop_function: DROP FUNCTION if_exists? uid // SET statements (configuration) -set_statement: SET config_name EQUAL_SYMBOL config_value +set_statement: SET config_name (EQUAL_SYMBOL | TO) config_value config_name: uid diff --git a/evadb/parser/set_statement.py b/evadb/parser/set_statement.py index ff2defe536..9ee1ea93db 100644 --- a/evadb/parser/set_statement.py +++ b/evadb/parser/set_statement.py @@ -22,16 +22,16 @@ class SetStatement(AbstractStatement): def __init__(self, config_name: str, config_value: Any): super().__init__(StatementType.SET) - self.config_name = config_name - self.config_value = config_value + self._config_name = config_name + self._config_value = config_value @property def config_name(self): - return self.config_name + return self._config_name @property def config_value(self): - return self.config_value + return self._config_value def __str__(self): return f"SET {str(self.config_name)} = {str(self.config_value)}" diff --git a/test/integration_tests/short/test_set_executor.py b/test/integration_tests/short/test_set_executor.py new file mode 100644 index 0000000000..ddc515ad64 --- /dev/null +++ b/test/integration_tests/short/test_set_executor.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# Copyright 2018-2023 EvaDB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import unittest +from test.util import get_evadb_for_testing + +import pytest + +from evadb.server.command_handler import execute_query_fetch_all + +NUM_FRAMES = 10 + + +@pytest.mark.notparallel +class SetExecutorTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.evadb = get_evadb_for_testing() + cls.evadb.catalog().reset() + + @classmethod + def tearDownClass(cls): + pass + + # integration test + def test_set_execution(self): + execute_query_fetch_all(self.evadb, "SET OPENAIKEY = 'ABCD';") + current_config_value = self.evadb.config.get_value("default", "OPENAIKEY") + + self.assertEqual("ABCD", current_config_value) diff --git a/test/unit_tests/parser/test_parser.py b/test/unit_tests/parser/test_parser.py index 0c134d8b63..9ef88a2d5f 100644 --- a/test/unit_tests/parser/test_parser.py +++ b/test/unit_tests/parser/test_parser.py @@ -36,6 +36,7 @@ from evadb.parser.parser import Parser from evadb.parser.rename_statement import RenameTableStatement from evadb.parser.select_statement import SelectStatement +from evadb.parser.set_statement import SetStatement from evadb.parser.statement import AbstractStatement, StatementType from evadb.parser.table_ref import JoinNode, TableInfo, TableRef, TableValuedExpression from evadb.parser.types import ( @@ -692,6 +693,21 @@ def test_delete_statement(self): ) self.assertEqual(delete_stmt, expected_stmt) + + def test_set_statement(self): + parser = Parser() + set_statement = """SET OPENAIKEY = 'ABCD'""" + evadb_statement_list = parser.parse(set_statement) + + self.assertIsInstance(evadb_statement_list, list) + self.assertEqual(len(evadb_statement_list), 1) + self.assertEqual(evadb_statement_list[0].stmt_type, StatementType.SET) + + set_stmt = evadb_statement_list[0] + + expected_stmt = SetStatement("OPENAIKEY", ConstantValueExpression("ABCD", ColumnType.TEXT)) + + self.assertEqual(set_stmt, expected_stmt) def test_create_predict_function_statement(self): parser = Parser() From 22ae18f177ea3c980edfe186a4ad0c8493da2571 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 10:52:39 -0400 Subject: [PATCH 07/11] Lint changes --- evadb/executor/set_executor.py | 18 +++++++++--------- .../short/test_set_executor.py | 2 +- .../test_statement_to_opr_converter.py | 2 +- test/unit_tests/parser/test_parser.py | 6 ++++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py index ce3fee2727..0938aeee2d 100644 --- a/evadb/executor/set_executor.py +++ b/evadb/executor/set_executor.py @@ -26,17 +26,17 @@ def __init__(self, db: EvaDBDatabase, node: SetPlan): def exec(self, *args, **kwargs): # Get method implementation from the config.update_value """ - NOTE :- Currently adding adding all configs in 'default' category. - The idea is to deprecate category to maintain the same format for - the query as DuckDB and Postgres + NOTE :- Currently adding adding all configs in 'default' category. + The idea is to deprecate category to maintain the same format for + the query as DuckDB and Postgres - Ref :- - https://www.postgresql.org/docs/7.0/sql-set.htm - https://duckdb.org/docs/sql/configuration.html + Ref :- + https://www.postgresql.org/docs/7.0/sql-set.htm + https://duckdb.org/docs/sql/configuration.html - This design change for configuation manager will be taken care of - as a separate PR for the issue #1140, where all instances of config use - will be replaced + This design change for configuation manager will be taken care of + as a separate PR for the issue #1140, where all instances of config use + will be replaced """ self._config.update_value( category="default", key=SetPlan.config_name, value=SetPlan.config_value diff --git a/test/integration_tests/short/test_set_executor.py b/test/integration_tests/short/test_set_executor.py index ddc515ad64..d732681433 100644 --- a/test/integration_tests/short/test_set_executor.py +++ b/test/integration_tests/short/test_set_executor.py @@ -37,5 +37,5 @@ def tearDownClass(cls): def test_set_execution(self): execute_query_fetch_all(self.evadb, "SET OPENAIKEY = 'ABCD';") current_config_value = self.evadb.config.get_value("default", "OPENAIKEY") - + self.assertEqual("ABCD", current_config_value) diff --git a/test/unit_tests/optimizer/test_statement_to_opr_converter.py b/test/unit_tests/optimizer/test_statement_to_opr_converter.py index 7936d14b3c..a587be7c76 100644 --- a/test/unit_tests/optimizer/test_statement_to_opr_converter.py +++ b/test/unit_tests/optimizer/test_statement_to_opr_converter.py @@ -319,7 +319,7 @@ def test_check_plan_equality(self): extract_object_plan = LogicalExtractObject( MagicMock(), MagicMock(), MagicMock(), MagicMock() ) - + create_plan.append_child(create_function_plan) plans.append(dummy_plan) diff --git a/test/unit_tests/parser/test_parser.py b/test/unit_tests/parser/test_parser.py index 9ef88a2d5f..d40e504a4c 100644 --- a/test/unit_tests/parser/test_parser.py +++ b/test/unit_tests/parser/test_parser.py @@ -693,7 +693,7 @@ def test_delete_statement(self): ) self.assertEqual(delete_stmt, expected_stmt) - + def test_set_statement(self): parser = Parser() set_statement = """SET OPENAIKEY = 'ABCD'""" @@ -705,7 +705,9 @@ def test_set_statement(self): set_stmt = evadb_statement_list[0] - expected_stmt = SetStatement("OPENAIKEY", ConstantValueExpression("ABCD", ColumnType.TEXT)) + expected_stmt = SetStatement( + "OPENAIKEY", ConstantValueExpression("ABCD", ColumnType.TEXT) + ) self.assertEqual(set_stmt, expected_stmt) From d19c1e521dd201e17faebb98a1998f030ac8e195 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 16:18:24 -0400 Subject: [PATCH 08/11] Moved SetStatement to the list of SKIP_BINDER_AND_OPTIMIZER_STATEMENTS modified: evadb/executor/plan_executor.py modified: evadb/executor/set_executor.py modified: evadb/parser/utils.py modified: test/unit_tests/parser/test_parser.py --- evadb/executor/plan_executor.py | 6 ++++-- evadb/executor/set_executor.py | 4 +++- evadb/parser/utils.py | 7 ++++++- test/unit_tests/parser/test_parser.py | 16 ++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/evadb/executor/plan_executor.py b/evadb/executor/plan_executor.py index b1bf186de3..9d0bbacd01 100644 --- a/evadb/executor/plan_executor.py +++ b/evadb/executor/plan_executor.py @@ -42,6 +42,7 @@ from evadb.executor.rename_executor import RenameExecutor from evadb.executor.sample_executor import SampleExecutor from evadb.executor.seq_scan_executor import SequentialScanExecutor +from evadb.executor.set_executor import SetExecutor from evadb.executor.show_info_executor import ShowInfoExecutor from evadb.executor.storage_executor import StorageExecutor from evadb.executor.union_executor import UnionExecutor @@ -49,6 +50,7 @@ from evadb.executor.vector_index_scan_executor import VectorIndexScanExecutor from evadb.models.storage.batch import Batch from evadb.parser.create_statement import CreateDatabaseStatement +from evadb.parser.set_statement import SetStatement from evadb.parser.statement import AbstractStatement from evadb.parser.use_statement import UseStatement from evadb.plan_nodes.abstract_plan import AbstractPlan @@ -90,6 +92,8 @@ def _build_execution_tree( return CreateDatabaseExecutor(db=self._db, node=plan) elif isinstance(plan, UseStatement): return UseExecutor(db=self._db, node=plan) + elif isinstance(plan, SetStatement): + return SetExecutor(db=self._db, node=plan) # Get plan node type plan_opr_type = plan.opr_type @@ -156,8 +160,6 @@ def _build_execution_tree( executor_node = VectorIndexScanExecutor(db=self._db, node=plan) elif plan_opr_type == PlanOprType.DELETE: executor_node = DeleteExecutor(db=self._db, node=plan) - elif plan_opr_type == PlanOprType.SET: - executor_node = SetExecutor(db=self._db, node=plan) # EXPLAIN does not need to build execution tree for its children if plan_opr_type != PlanOprType.EXPLAIN: diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py index 0938aeee2d..aee241b0dd 100644 --- a/evadb/executor/set_executor.py +++ b/evadb/executor/set_executor.py @@ -39,5 +39,7 @@ def exec(self, *args, **kwargs): will be replaced """ self._config.update_value( - category="default", key=SetPlan.config_name, value=SetPlan.config_value + category="default", + key=self.node.config_name, + value=self.node.config_value.value, ) diff --git a/evadb/parser/utils.py b/evadb/parser/utils.py index 3ad9b032f1..b387e4bd3b 100644 --- a/evadb/parser/utils.py +++ b/evadb/parser/utils.py @@ -24,10 +24,15 @@ from evadb.parser.show_statement import ShowStatement from evadb.parser.types import ObjectType from evadb.parser.use_statement import UseStatement +from evadb.parser.set_statement import SetStatement # List of statements for which we omit binder and optimizer and pass the statement # directly to the executor. -SKIP_BINDER_AND_OPTIMIZER_STATEMENTS = (CreateDatabaseStatement, UseStatement) +SKIP_BINDER_AND_OPTIMIZER_STATEMENTS = ( + CreateDatabaseStatement, + UseStatement, + SetStatement, +) def parse_expression(expr: str): diff --git a/test/unit_tests/parser/test_parser.py b/test/unit_tests/parser/test_parser.py index d40e504a4c..f9005b0a6c 100644 --- a/test/unit_tests/parser/test_parser.py +++ b/test/unit_tests/parser/test_parser.py @@ -711,6 +711,22 @@ def test_set_statement(self): self.assertEqual(set_stmt, expected_stmt) + # TESTING 'TO' IN PLACE OF '=' + set_statement = """SET OPENAIKEY TO 'ABCD'""" + evadb_statement_list = parser.parse(set_statement) + + self.assertIsInstance(evadb_statement_list, list) + self.assertEqual(len(evadb_statement_list), 1) + self.assertEqual(evadb_statement_list[0].stmt_type, StatementType.SET) + + set_stmt = evadb_statement_list[0] + + expected_stmt = SetStatement( + "OPENAIKEY", ConstantValueExpression("ABCD", ColumnType.TEXT) + ) + + self.assertEqual(set_stmt, expected_stmt) + def test_create_predict_function_statement(self): parser = Parser() create_func_query = """ From b7ee3b60a3e119b918def6104c804ae9d8066b3f Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 16:33:41 -0400 Subject: [PATCH 09/11] Fixed linter and unit test cases modified: evadb/executor/set_executor.py modified: evadb/plan_nodes/set_plan.py --- evadb/executor/set_executor.py | 2 -- evadb/plan_nodes/set_plan.py | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py index aee241b0dd..2470228f77 100644 --- a/evadb/executor/set_executor.py +++ b/evadb/executor/set_executor.py @@ -12,8 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import pandas as pd - from evadb.database import EvaDBDatabase from evadb.executor.abstract_executor import AbstractExecutor from evadb.plan_nodes.set_plan import SetPlan diff --git a/evadb/plan_nodes/set_plan.py b/evadb/plan_nodes/set_plan.py index ce0758444e..746b483dd9 100644 --- a/evadb/plan_nodes/set_plan.py +++ b/evadb/plan_nodes/set_plan.py @@ -19,17 +19,17 @@ class SetPlan(AbstractPlan): def __init__(self, config_name: str, config_value: Any): - self.config_name = config_name - self.config_value = config_value + self._config_name = config_name + self._config_value = config_value super().__init__(PlanOprType.SET) @property def config_name(self): - return self.config_name + return self._config_name @property def config_value(self): - return self.config_value + return self._config_value def __str__(self): return "SetPlan(config_name={}, \ From 182aca4768f992746ad9f869670794271b39dd66 Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 16:50:44 -0400 Subject: [PATCH 10/11] Resolved linter issues --- evadb/optimizer/statement_to_opr_converter.py | 4 ++-- evadb/parser/lark_visitor/__init__.py | 2 +- evadb/parser/set_statement.py | 1 + evadb/parser/utils.py | 2 +- evadb/plan_nodes/set_plan.py | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/evadb/optimizer/statement_to_opr_converter.py b/evadb/optimizer/statement_to_opr_converter.py index 7e8c52eda0..02604ee65d 100644 --- a/evadb/optimizer/statement_to_opr_converter.py +++ b/evadb/optimizer/statement_to_opr_converter.py @@ -36,9 +36,9 @@ LogicalQueryDerivedGet, LogicalRename, LogicalSample, + LogicalSet, LogicalShow, LogicalUnion, - LogicalSet, ) from evadb.optimizer.optimizer_utils import ( column_definition_to_function_io, @@ -54,8 +54,8 @@ from evadb.parser.load_statement import LoadDataStatement from evadb.parser.rename_statement import RenameTableStatement from evadb.parser.select_statement import SelectStatement -from evadb.parser.show_statement import ShowStatement from evadb.parser.set_statement import SetStatement +from evadb.parser.show_statement import ShowStatement from evadb.parser.statement import AbstractStatement from evadb.parser.table_ref import JoinNode, TableRef, TableValuedExpression from evadb.parser.types import FunctionType, JoinType diff --git a/evadb/parser/lark_visitor/__init__.py b/evadb/parser/lark_visitor/__init__.py index ad32b6d80c..9ed0a1b6fe 100644 --- a/evadb/parser/lark_visitor/__init__.py +++ b/evadb/parser/lark_visitor/__init__.py @@ -31,10 +31,10 @@ from evadb.parser.lark_visitor._load_statement import Load from evadb.parser.lark_visitor._rename_statement import RenameTable from evadb.parser.lark_visitor._select_statement import Select +from evadb.parser.lark_visitor._set_statement import Set from evadb.parser.lark_visitor._show_statements import Show from evadb.parser.lark_visitor._table_sources import TableSources from evadb.parser.lark_visitor._use_statement import Use -from evadb.parser.lark_visitor._set_statement import Set # To add new functionality to the parser, create a new file under # the lark_visitor directory, and implement a new class which diff --git a/evadb/parser/set_statement.py b/evadb/parser/set_statement.py index 9ee1ea93db..eab848c27d 100644 --- a/evadb/parser/set_statement.py +++ b/evadb/parser/set_statement.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import annotations + from typing import Any from evadb.parser.statement import AbstractStatement diff --git a/evadb/parser/utils.py b/evadb/parser/utils.py index b387e4bd3b..28f13e0a98 100644 --- a/evadb/parser/utils.py +++ b/evadb/parser/utils.py @@ -21,10 +21,10 @@ from evadb.parser.parser import Parser from evadb.parser.rename_statement import RenameTableStatement from evadb.parser.select_statement import SelectStatement +from evadb.parser.set_statement import SetStatement from evadb.parser.show_statement import ShowStatement from evadb.parser.types import ObjectType from evadb.parser.use_statement import UseStatement -from evadb.parser.set_statement import SetStatement # List of statements for which we omit binder and optimizer and pass the statement # directly to the executor. diff --git a/evadb/plan_nodes/set_plan.py b/evadb/plan_nodes/set_plan.py index 746b483dd9..cbc0ddf19e 100644 --- a/evadb/plan_nodes/set_plan.py +++ b/evadb/plan_nodes/set_plan.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. from typing import Any + from evadb.plan_nodes.abstract_plan import AbstractPlan from evadb.plan_nodes.types import PlanOprType From 9534c083ddb238177a8309d4913f0b543a105cdc Mon Sep 17 00:00:00 2001 From: hershd23 Date: Fri, 22 Sep 2023 17:37:09 -0400 Subject: [PATCH 11/11] Removed plan and optimizer artifacts from Set query since we are skipping those modified: evadb/executor/set_executor.py modified: evadb/optimizer/operators.py modified: evadb/optimizer/statement_to_opr_converter.py deleted: evadb/plan_nodes/set_plan.py modified: evadb/plan_nodes/types.py modified: test/unit_tests/optimizer/test_statement_to_opr_converter.py --- evadb/executor/set_executor.py | 4 +- evadb/optimizer/operators.py | 47 ------------------- evadb/optimizer/statement_to_opr_converter.py | 8 ---- evadb/plan_nodes/set_plan.py | 42 ----------------- evadb/plan_nodes/types.py | 1 - .../test_statement_to_opr_converter.py | 3 -- 6 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 evadb/plan_nodes/set_plan.py diff --git a/evadb/executor/set_executor.py b/evadb/executor/set_executor.py index 2470228f77..4adfe6c059 100644 --- a/evadb/executor/set_executor.py +++ b/evadb/executor/set_executor.py @@ -14,11 +14,11 @@ # limitations under the License. from evadb.database import EvaDBDatabase from evadb.executor.abstract_executor import AbstractExecutor -from evadb.plan_nodes.set_plan import SetPlan +from evadb.parser.set_statement import SetStatement class SetExecutor(AbstractExecutor): - def __init__(self, db: EvaDBDatabase, node: SetPlan): + def __init__(self, db: EvaDBDatabase, node: SetStatement): super().__init__(db, node) def exec(self, *args, **kwargs): diff --git a/evadb/optimizer/operators.py b/evadb/optimizer/operators.py index 8a4b7caf30..59d6fa1c09 100644 --- a/evadb/optimizer/operators.py +++ b/evadb/optimizer/operators.py @@ -64,7 +64,6 @@ class OperatorType(IntEnum): LOGICAL_EXTRACT_OBJECT = auto() LOGICAL_VECTOR_INDEX_SCAN = auto() LOGICAL_USE = auto() - LOGICALSET = auto() LOGICALDELIMITER = auto() @@ -1251,49 +1250,3 @@ def __hash__(self) -> int: self.search_query_expr, ) ) - - -class LogicalSet(Operator): - """[Logical Node for Set Operation] - - Arguments: - config_name(str): The config_name to add, - config_value(Any): The config_value to add, - """ - - def __init__( - self, - config_name: str, - config_value: Any, - children=None, - ): - super().__init__(OperatorType.LOGICALSET, children) - self._config_name = config_name - self._config_value = config_value - - @property - def config_name(self): - return self._config_name - - @property - def config_value(self): - return self._config_value - - def __eq__(self, other): - is_subtree_equal = super().__eq__(other) - if not isinstance(other, LogicalSet): - return False - return ( - is_subtree_equal - and self.config_name == other.config_name - and self.config_value == other.config_value - ) - - def __hash__(self) -> int: - return hash( - ( - super().__hash__(), - self.config_name, - self.config_value, - ) - ) diff --git a/evadb/optimizer/statement_to_opr_converter.py b/evadb/optimizer/statement_to_opr_converter.py index 02604ee65d..d0e36e16a3 100644 --- a/evadb/optimizer/statement_to_opr_converter.py +++ b/evadb/optimizer/statement_to_opr_converter.py @@ -36,7 +36,6 @@ LogicalQueryDerivedGet, LogicalRename, LogicalSample, - LogicalSet, LogicalShow, LogicalUnion, ) @@ -54,7 +53,6 @@ from evadb.parser.load_statement import LoadDataStatement from evadb.parser.rename_statement import RenameTableStatement from evadb.parser.select_statement import SelectStatement -from evadb.parser.set_statement import SetStatement from evadb.parser.show_statement import ShowStatement from evadb.parser.statement import AbstractStatement from evadb.parser.table_ref import JoinNode, TableRef, TableValuedExpression @@ -372,10 +370,6 @@ def visit_delete(self, statement: DeleteTableStatement): ) self._plan = delete_opr - def visit_set(self, statement: SetStatement): - set_opr = LogicalSet(statement.config_name, statement.config_value) - self._plan = set_opr - def visit(self, statement: AbstractStatement): """Based on the instance of the statement the corresponding visit is called. @@ -406,8 +400,6 @@ def visit(self, statement: AbstractStatement): self.visit_create_index(statement) elif isinstance(statement, DeleteTableStatement): self.visit_delete(statement) - elif isinstance(statement, SetStatement): - self.visit_set(statement) return self._plan @property diff --git a/evadb/plan_nodes/set_plan.py b/evadb/plan_nodes/set_plan.py deleted file mode 100644 index cbc0ddf19e..0000000000 --- a/evadb/plan_nodes/set_plan.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# Copyright 2018-2023 EvaDB -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from typing import Any - -from evadb.plan_nodes.abstract_plan import AbstractPlan -from evadb.plan_nodes.types import PlanOprType - - -class SetPlan(AbstractPlan): - def __init__(self, config_name: str, config_value: Any): - self._config_name = config_name - self._config_value = config_value - super().__init__(PlanOprType.SET) - - @property - def config_name(self): - return self._config_name - - @property - def config_value(self): - return self._config_value - - def __str__(self): - return "SetPlan(config_name={}, \ - config_value={})".format( - self.config_name, self.config_value - ) - - def __hash__(self) -> int: - return hash((super().__hash__(), self.config_name, self.config_value)) diff --git a/evadb/plan_nodes/types.py b/evadb/plan_nodes/types.py index 7ccf95e6ac..7b989e8e89 100644 --- a/evadb/plan_nodes/types.py +++ b/evadb/plan_nodes/types.py @@ -48,5 +48,4 @@ class PlanOprType(Enum): VECTOR_INDEX_SCAN = auto() NATIVE = auto() SQLALCHEMY = auto() - SET = auto() # add other types diff --git a/test/unit_tests/optimizer/test_statement_to_opr_converter.py b/test/unit_tests/optimizer/test_statement_to_opr_converter.py index a587be7c76..d60284b135 100644 --- a/test/unit_tests/optimizer/test_statement_to_opr_converter.py +++ b/test/unit_tests/optimizer/test_statement_to_opr_converter.py @@ -42,7 +42,6 @@ LogicalQueryDerivedGet, LogicalRename, LogicalSample, - LogicalSet, LogicalShow, LogicalUnion, LogicalVectorIndexScan, @@ -282,7 +281,6 @@ def test_inequality_in_operator(self): def test_check_plan_equality(self): plans = [] dummy_plan = Dummy(MagicMock(), MagicMock()) - set_plan = LogicalSet(MagicMock(), MagicMock()) create_plan = LogicalCreate(MagicMock(), MagicMock()) create_function_plan = LogicalCreateFunction( MagicMock(), MagicMock(), MagicMock(), MagicMock(), MagicMock(), MagicMock() @@ -348,7 +346,6 @@ def test_check_plan_equality(self): plans.append(faiss_plan) plans.append(project_plan) plans.append(extract_object_plan) - plans.append(set_plan) derived_operators = list(get_all_subclasses(Operator))