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

georgia-tech-db / eva / #837

19 Oct 2023 09:02AM UTC coverage: 0.0% (-78.6%) from 78.632%
#837

push

circle-ci

Andy Xu
Add CostEntry

0 of 12416 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/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
×
16

17
from evadb.database import EvaDBDatabase
×
18
from evadb.executor.abstract_executor import AbstractExecutor
×
19
from evadb.executor.executor_utils import (
×
20
    apply_predicate,
21
    apply_project,
22
    instrument_function_expression_cost,
23
)
24
from evadb.models.storage.batch import Batch
×
25
from evadb.plan_nodes.hash_join_probe_plan import HashJoinProbePlan
×
26

27

28
class HashJoinExecutor(AbstractExecutor):
×
29
    def __init__(self, db: EvaDBDatabase, node: HashJoinProbePlan):
×
30
        super().__init__(db, node)
×
31
        self.predicate = node.join_predicate
×
32
        self.join_type = node.join_type
×
33
        self.probe_keys = node.probe_keys
×
34
        self.join_project = node.join_project
×
35

36
    def exec(self, *args, **kwargs) -> Iterator[Batch]:
×
37
        build_table = self.children[0]
×
38
        probe_table = self.children[1]
×
39
        hash_keys = [key.col_alias for key in self.probe_keys]
×
40
        for build_batch in build_table.exec():
×
41
            for probe_batch in probe_table.exec():
×
42
                probe_batch.reassign_indices_to_hash(hash_keys)
×
43
                join_batch = Batch.join(probe_batch, build_batch)
×
44
                join_batch.reset_index()
×
45
                join_batch = apply_predicate(join_batch, self.predicate)
×
46
                join_batch = apply_project(join_batch, self.join_project)
×
47
                yield join_batch
×
48

49
        # instrument required stats
50
        if self.predicate or self.join_project:
×
51
            catalog = self.catalog()
×
52
            instrument_function_expression_cost(self.predicate, catalog)
×
53
            instrument_function_expression_cost(self.join_project, catalog)
×
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

© 2026 Coveralls, Inc