• 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

56.0
/evadb/executor/hash_join_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 typing import Iterator
1✔
16

17
from evadb.database import EvaDBDatabase
1✔
18
from evadb.executor.abstract_executor import AbstractExecutor
1✔
19
from evadb.executor.executor_utils import apply_predicate, apply_project
1✔
20
from evadb.models.storage.batch import Batch
1✔
21
from evadb.plan_nodes.hash_join_probe_plan import HashJoinProbePlan
1✔
22

23

24
class HashJoinExecutor(AbstractExecutor):
1✔
25
    def __init__(self, db: EvaDBDatabase, node: HashJoinProbePlan):
1✔
26
        super().__init__(db, node)
1✔
27
        self.predicate = node.join_predicate
1✔
28
        self.join_type = node.join_type
1✔
29
        self.probe_keys = node.probe_keys
1✔
30
        self.join_project = node.join_project
1✔
31

32
    def exec(self, *args, **kwargs) -> Iterator[Batch]:
1✔
33
        build_table = self.children[0]
×
34
        probe_table = self.children[1]
×
35
        hash_keys = [key.col_alias for key in self.probe_keys]
×
36
        for build_batch in build_table.exec():
×
37
            for probe_batch in probe_table.exec():
×
38
                probe_batch.reassign_indices_to_hash(hash_keys)
×
39
                join_batch = Batch.join(probe_batch, build_batch)
×
40
                join_batch.reset_index()
×
41
                join_batch = apply_predicate(join_batch, self.predicate, self.catalog())
×
42
                join_batch = apply_project(
×
43
                    join_batch, self.join_project, self.catalog()
44
                )
45
                yield join_batch
×
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