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

getdozer / dozer / 4112861806

pending completion
4112861806

Pull #811

github

GitHub
Merge d7683358e into 8f74ec17e
Pull Request #811: chore: integrating sql planner

705 of 705 new or added lines in 18 files covered. (100.0%)

23369 of 38348 relevant lines covered (60.94%)

33752.71 hits per line

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

82.69
/dozer-sql/src/pipeline/aggregation/count.rs
1
use crate::pipeline::aggregation::aggregator::AggregationResult;
2
use crate::pipeline::errors::PipelineError;
3
use crate::{deserialize, deserialize_i64};
4
use dozer_core::storage::prefix_transaction::PrefixTransaction;
5
use dozer_types::types::Field::Int;
6
use dozer_types::types::{Field, FieldType};
7

8
pub struct CountAggregator {}
9

10
impl CountAggregator {
11
    const _AGGREGATOR_ID: u32 = 0x02;
12

13
    pub(crate) fn _get_type() -> u32 {
×
14
        CountAggregator::_AGGREGATOR_ID
×
15
    }
×
16

17
    pub(crate) fn insert(
6,416✔
18
        cur_state: Option<&[u8]>,
6,416✔
19
        _new: &Field,
6,416✔
20
        _return_type: FieldType,
6,416✔
21
        _txn: &mut PrefixTransaction,
6,416✔
22
    ) -> Result<AggregationResult, PipelineError> {
6,416✔
23
        let prev = deserialize_i64!(cur_state);
6,416✔
24
        let buf = (prev + 1).to_be_bytes();
6,416✔
25
        Ok(AggregationResult::new(
6,416✔
26
            Self::get_value(&buf),
6,416✔
27
            Some(Vec::from(buf)),
6,416✔
28
        ))
6,416✔
29
    }
6,416✔
30

×
31
    pub(crate) fn update(
8✔
32
        cur_state: Option<&[u8]>,
8✔
33
        _old: &Field,
8✔
34
        _new: &Field,
8✔
35
        _return_type: FieldType,
8✔
36
        _txn: &mut PrefixTransaction,
8✔
37
    ) -> Result<AggregationResult, PipelineError> {
8✔
38
        let prev = deserialize_i64!(cur_state);
8✔
39
        let buf = (prev).to_be_bytes();
8✔
40
        Ok(AggregationResult::new(
8✔
41
            Self::get_value(&buf),
8✔
42
            Some(Vec::from(buf)),
8✔
43
        ))
8✔
44
    }
8✔
45

×
46
    pub(crate) fn delete(
27✔
47
        cur_state: Option<&[u8]>,
27✔
48
        _old: &Field,
27✔
49
        _return_type: FieldType,
27✔
50
        _txn: &mut PrefixTransaction,
27✔
51
    ) -> Result<AggregationResult, PipelineError> {
27✔
52
        let prev = deserialize_i64!(cur_state);
27✔
53
        let buf = (prev - 1).to_be_bytes();
27✔
54
        Ok(AggregationResult::new(
27✔
55
            Self::get_value(&buf),
27✔
56
            Some(Vec::from(buf)),
27✔
57
        ))
27✔
58
    }
27✔
59

×
60
    pub(crate) fn get_value(f: &[u8]) -> Field {
6,451✔
61
        Int(i64::from_be_bytes(deserialize!(f)))
6,451✔
62
    }
6,451✔
63
}
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