• 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/executor/create_executor.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 evadb.database import EvaDBDatabase
×
16
from evadb.executor.abstract_executor import AbstractExecutor
×
17
from evadb.executor.executor_utils import handle_if_not_exists
×
18
from evadb.plan_nodes.create_plan import CreatePlan
×
19
from evadb.storage.storage_engine import StorageEngine
×
20
from evadb.utils.logging_manager import logger
×
21

22

23
class CreateExecutor(AbstractExecutor):
×
24
    def __init__(self, db: EvaDBDatabase, node: CreatePlan):
×
25
        super().__init__(db, node)
×
26

27
    def exec(self, *args, **kwargs):
×
28
        if not handle_if_not_exists(
×
29
            self.catalog(), self.node.table_info, self.node.if_not_exists
30
        ):
31
            create_table_done = False
×
32
            logger.debug(f"Creating table {self.node.table_info}")
×
33

34
            catalog_entry = self.catalog().create_and_insert_table_catalog_entry(
×
35
                self.node.table_info, self.node.column_list
36
            )
37
            storage_engine = StorageEngine.factory(self.db, catalog_entry)
×
38
            try:
×
39
                storage_engine.create(table=catalog_entry)
×
40
                create_table_done = True
×
41
                if self.children != []:
×
42
                    assert (
×
43
                        len(self.children) == 1
44
                    ), "Create table from query expects 1 child, finds {}".format(
45
                        len(self.children)
46
                    )
47
                    child = self.children[0]
×
48

49
                    # Populate the table
50
                    for batch in child.exec():
×
51
                        batch.drop_column_alias()
×
52
                        storage_engine.write(catalog_entry, batch)
×
53
            except Exception as e:
54
                # rollback if the create call fails
55
                if create_table_done:
56
                    storage_engine.drop(catalog_entry)
57
                raise e
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