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

georgia-tech-db / eva / #754

04 Sep 2023 09:54PM UTC coverage: 74.807% (-5.5%) from 80.336%
#754

push

circle-ci

jiashenC
update case

8727 of 11666 relevant lines covered (74.81%)

0.75 hits per line

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

87.5
/evadb/executor/load_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
1✔
16
from evadb.executor.abstract_executor import AbstractExecutor
1✔
17
from evadb.executor.load_csv_executor import LoadCSVExecutor
1✔
18
from evadb.executor.load_multimedia_executor import LoadMultimediaExecutor
1✔
19
from evadb.parser.types import FileFormatType
1✔
20
from evadb.plan_nodes.load_data_plan import LoadDataPlan
1✔
21

22

23
class LoadDataExecutor(AbstractExecutor):
1✔
24
    def __init__(self, db: EvaDBDatabase, node: LoadDataPlan):
1✔
25
        super().__init__(db, node)
1✔
26

27
    def exec(self, *args, **kwargs):
1✔
28
        """
29
        Use TYPE to determine the type of data to load.
30
        """
31

32
        # invoke the appropriate executor
33
        if self.node.file_options["file_format"] in [
1✔
34
            FileFormatType.VIDEO,
35
            FileFormatType.IMAGE,
36
            FileFormatType.DOCUMENT,
37
            FileFormatType.PDF,
38
        ]:
39
            executor = LoadMultimediaExecutor(self.db, self.node)
1✔
40
        elif self.node.file_options["file_format"] == FileFormatType.CSV:
×
41
            executor = LoadCSVExecutor(self.db, self.node)
×
42

43
        # for each batch, exec the executor
44
        for batch in executor.exec():
1✔
45
            yield batch
1✔
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