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

georgia-tech-db / eva / #758

04 Sep 2023 08:37PM UTC coverage: 0.0% (-78.3%) from 78.333%
#758

push

circle-ci

hershd23
Increased underline length in at line 75 in text_summarization.rst
	modified:   docs/source/benchmarks/text_summarization.rst

0 of 11303 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/evadb/parser/insert_statement.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
×
16

17
from evadb.expression.abstract_expression import AbstractExpression
×
18
from evadb.parser.statement import AbstractStatement
×
19
from evadb.parser.table_ref import TableRef
×
20
from evadb.parser.types import StatementType
×
21

22

23
class InsertTableStatement(AbstractStatement):
×
24
    """
25
    Insert Table Statement constructed after parsing the input query
26

27
    Attributes
28
    ----------
29
    TableRef:
30
        table reference in the insert table statement
31
    ColumnList:
32
        list of columns
33
    ValueList:
34
        list of values to fill
35
    """
36

37
    def __init__(
×
38
        self,
39
        table_ref: TableRef,
40
        column_list: List[AbstractExpression] = None,
41
        value_list: List[AbstractExpression] = None,
42
    ):
43
        super().__init__(StatementType.INSERT)
×
44
        self._table_ref = table_ref
×
45
        self._column_list = column_list
×
46
        self._value_list = value_list
×
47

48
    def __str__(self) -> str:
×
49
        column_list_str = ""
×
50
        if self._column_list is not None:
×
51
            for expr in self._column_list:
×
52
                column_list_str += str(expr) + ", "
×
53
            column_list_str = column_list_str.rstrip(", ")
×
54

55
        value_list_str = ""
×
56
        if self._value_list is not None:
×
57
            for expr in self._value_list:
×
58
                value_list_str += str(expr) + ", "
×
59
            value_list_str = value_list_str.rstrip(", ")
×
60

61
        print_str = "INSERT INTO {}({}) VALUES ({}) ".format(
×
62
            self._table_ref, column_list_str, value_list_str
63
        )
64
        return print_str
×
65

66
    @property
×
67
    def table_ref(self) -> TableRef:
×
68
        return self._table_ref
×
69

70
    @property
×
71
    def column_list(self) -> List[AbstractExpression]:
×
72
        return self._column_list
×
73

74
    @property
×
75
    def value_list(self) -> List[AbstractExpression]:
×
76
        return self._value_list
×
77

78
    def __eq__(self, other):
×
79
        if not isinstance(other, InsertTableStatement):
×
80
            return False
×
81
        return (
×
82
            self.table_ref == other.table_ref
83
            and self.column_list == other.column_list
84
            and self.value_list == other.value_list
85
        )
86

87
    def __hash__(self) -> int:
×
88
        return hash(
×
89
            (
90
                super().__hash__(),
91
                self.table_ref,
92
                tuple(self.column_list),
93
                tuple(self.value_list),
94
            )
95
        )
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