• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

georgia-tech-db / eva / cec02fdb-5a3a-48f3-aae2-a31d81ff6bcb

02 Oct 2023 02:07PM UTC coverage: 69.34% (+69.3%) from 0.0%
cec02fdb-5a3a-48f3-aae2-a31d81ff6bcb

Pull #1244

circle-ci

jiashenC
remove * expr
Pull Request #1244: feat: create index from projection

100 of 100 new or added lines in 12 files covered. (100.0%)

8585 of 12381 relevant lines covered (69.34%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.36
/evadb/plan_nodes/create_index_plan.py
1
# coding=utf-8
2
# Copyright 2018-2023 EvaDB
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
from typing import List
1✔
16

17
from evadb.catalog.catalog_type import VectorStoreType
1✔
18
from evadb.expression.abstract_expression import AbstractExpression
1✔
19
from evadb.expression.function_expression import FunctionExpression
1✔
20
from evadb.parser.create_statement import ColumnDefinition
1✔
21
from evadb.parser.table_ref import TableRef
1✔
22
from evadb.plan_nodes.abstract_plan import AbstractPlan
1✔
23
from evadb.plan_nodes.types import PlanOprType
1✔
24

25

26
class CreateIndexPlan(AbstractPlan):
1✔
27
    def __init__(
1✔
28
        self,
29
        name: str,
30
        if_not_exists: bool,
31
        table_ref: TableRef,
32
        col_list: List[ColumnDefinition],
33
        vector_store_type: VectorStoreType,
34
        project_expr_list: List[AbstractExpression],
35
        index_def: str,
36
    ):
37
        super().__init__(PlanOprType.CREATE_INDEX)
1✔
38
        self._name = name
1✔
39
        self._if_not_exists = if_not_exists
1✔
40
        self._table_ref = table_ref
1✔
41
        self._col_list = col_list
1✔
42
        self._vector_store_type = vector_store_type
1✔
43
        self._project_expr_list = project_expr_list
1✔
44
        self._index_def = index_def
1✔
45

46
    @property
1✔
47
    def name(self):
1✔
48
        return self._name
1✔
49

50
    @property
1✔
51
    def if_not_exists(self):
1✔
52
        return self._if_not_exists
1✔
53

54
    @property
1✔
55
    def table_ref(self):
1✔
56
        return self._table_ref
1✔
57

58
    @property
1✔
59
    def col_list(self):
1✔
60
        return self._col_list
1✔
61

62
    @property
1✔
63
    def vector_store_type(self):
1✔
64
        return self._vector_store_type
1✔
65

66
    @property
1✔
67
    def project_expr_list(self):
1✔
68
        return self._project_expr_list
1✔
69

70
    @property
1✔
71
    def index_def(self):
1✔
72
        return self._index_def
1✔
73

74
    def __str__(self):
1✔
75
        function_expr = None
×
76
        for project_expr in self._project_expr_list:
×
77
            if isinstance(project_expr, FunctionExpression):
×
78
                function_expr = project_expr
×
79

80
        return "CreateIndexPlan(name={}, \
×
81
            table_ref={}, \
82
            col_list={}, \
83
            vector_store_type={}, \
84
            {})".format(
85
            self._name,
86
            self._table_ref,
87
            tuple(self._col_list),
88
            self._vector_store_type,
89
            "" if function_expr is None else "function={}".format(function_expr),
90
        )
91

92
    def __hash__(self) -> int:
1✔
93
        return hash(
1✔
94
            (
95
                super().__hash__(),
96
                self.name,
97
                self.if_not_exists,
98
                self.table_ref,
99
                tuple(self.col_list),
100
                self.vector_store_type,
101
                tuple(self.project_expr_list),
102
                self.index_def,
103
            )
104
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc