line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator::UniqConcatenate; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.23"; |
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
29643
|
use strict; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
149
|
|
6
|
6
|
|
|
6
|
|
31
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
138
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
323
|
use App::RecordStream::Aggregator; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
118
|
|
9
|
6
|
|
|
6
|
|
455
|
use App::RecordStream::DomainLanguage::Registry; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
111
|
|
10
|
6
|
|
|
6
|
|
29
|
use App::RecordStream::DomainLanguage::Valuation::KeySpec; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
144
|
|
11
|
|
|
|
|
|
|
|
12
|
6
|
|
|
6
|
|
30
|
use base qw(App::RecordStream::Aggregator::Aggregation); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
1963
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new |
15
|
|
|
|
|
|
|
{ |
16
|
1
|
|
|
1
|
0
|
21
|
my $class = shift; |
17
|
1
|
|
|
|
|
4
|
my $delim = shift; |
18
|
1
|
|
|
|
|
3
|
my $field = shift; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
15
|
return new_from_valuation($class, $delim, App::RecordStream::DomainLanguage::Valuation::KeySpec->new($field)); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new_from_valuation |
24
|
|
|
|
|
|
|
{ |
25
|
11
|
|
|
11
|
0
|
29
|
my $class = shift; |
26
|
11
|
|
|
|
|
22
|
my $delim = shift; |
27
|
11
|
|
|
|
|
108
|
my $valuation = shift; |
28
|
|
|
|
|
|
|
|
29
|
11
|
|
|
|
|
39
|
my $this = |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
'valuation' => $valuation, |
32
|
|
|
|
|
|
|
'delim' => $delim, |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
11
|
|
|
|
|
27
|
bless $this, $class; |
36
|
|
|
|
|
|
|
|
37
|
11
|
|
|
|
|
38
|
return $this; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub squish |
41
|
|
|
|
|
|
|
{ |
42
|
8
|
|
|
8
|
0
|
23
|
my ($this, $cookie) = @_; |
43
|
|
|
|
|
|
|
|
44
|
8
|
|
|
|
|
54
|
return join($this->{'delim'}, sort(keys(%$cookie))); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub long_usage |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
0
|
0
|
0
|
return <
|
50
|
|
|
|
|
|
|
Usage: uconcat,, |
51
|
|
|
|
|
|
|
Concatenate unique values from specified field. |
52
|
|
|
|
|
|
|
EOF |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub short_usage |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
0
|
0
|
0
|
return "concatenate unique values from provided field"; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub argct |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
0
|
0
|
0
|
return 2; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub initial |
66
|
|
|
|
|
|
|
{ |
67
|
8
|
|
|
8
|
0
|
29
|
return {}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub combine |
71
|
|
|
|
|
|
|
{ |
72
|
29
|
|
|
29
|
0
|
76
|
my ($this, $cookie, $record) = @_; |
73
|
|
|
|
|
|
|
|
74
|
29
|
|
|
|
|
108
|
my $value = $this->{'valuation'}->evaluate_record($record); |
75
|
|
|
|
|
|
|
|
76
|
29
|
|
|
|
|
83
|
$cookie->{$value} = 1; |
77
|
|
|
|
|
|
|
|
78
|
29
|
|
|
|
|
104
|
return $cookie; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
App::RecordStream::Aggregator->register_implementation('uconcatenate', __PACKAGE__); |
82
|
|
|
|
|
|
|
App::RecordStream::Aggregator->register_implementation('uconcat', __PACKAGE__); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'uconcatenate', 'SCALAR', 'VALUATION'); |
85
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'uconcat', 'SCALAR', 'VALUATION'); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |