| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator::UniqConcatenate; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.24"; |
|
4
|
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
74428
|
use strict; |
|
|
6
|
|
|
|
|
13
|
|
|
|
6
|
|
|
|
|
152
|
|
|
6
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
|
6
|
|
|
|
|
13
|
|
|
|
6
|
|
|
|
|
154
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
277
|
use App::RecordStream::Aggregator; |
|
|
6
|
|
|
|
|
16
|
|
|
|
6
|
|
|
|
|
121
|
|
|
9
|
6
|
|
|
6
|
|
444
|
use App::RecordStream::DomainLanguage::Registry; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
121
|
|
|
10
|
6
|
|
|
6
|
|
28
|
use App::RecordStream::DomainLanguage::Valuation::KeySpec; |
|
|
6
|
|
|
|
|
13
|
|
|
|
6
|
|
|
|
|
143
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
6
|
|
|
6
|
|
33
|
use base qw(App::RecordStream::Aggregator::Aggregation); |
|
|
6
|
|
|
|
|
39
|
|
|
|
6
|
|
|
|
|
2213
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new |
|
15
|
|
|
|
|
|
|
{ |
|
16
|
1
|
|
|
1
|
0
|
91
|
my $class = shift; |
|
17
|
1
|
|
|
|
|
2
|
my $delim = shift; |
|
18
|
1
|
|
|
|
|
3
|
my $field = shift; |
|
19
|
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
11
|
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
|
|
|
|
|
24
|
my $delim = shift; |
|
27
|
11
|
|
|
|
|
95
|
my $valuation = shift; |
|
28
|
|
|
|
|
|
|
|
|
29
|
11
|
|
|
|
|
48
|
my $this = |
|
30
|
|
|
|
|
|
|
{ |
|
31
|
|
|
|
|
|
|
'valuation' => $valuation, |
|
32
|
|
|
|
|
|
|
'delim' => $delim, |
|
33
|
|
|
|
|
|
|
}; |
|
34
|
|
|
|
|
|
|
|
|
35
|
11
|
|
|
|
|
30
|
bless $this, $class; |
|
36
|
|
|
|
|
|
|
|
|
37
|
11
|
|
|
|
|
35
|
return $this; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub squish |
|
41
|
|
|
|
|
|
|
{ |
|
42
|
8
|
|
|
8
|
0
|
21
|
my ($this, $cookie) = @_; |
|
43
|
|
|
|
|
|
|
|
|
44
|
8
|
|
|
|
|
60
|
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
|
24
|
return {}; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub combine |
|
71
|
|
|
|
|
|
|
{ |
|
72
|
29
|
|
|
29
|
0
|
66
|
my ($this, $cookie, $record) = @_; |
|
73
|
|
|
|
|
|
|
|
|
74
|
29
|
|
|
|
|
104
|
my $value = $this->{'valuation'}->evaluate_record($record); |
|
75
|
|
|
|
|
|
|
|
|
76
|
29
|
|
|
|
|
81
|
$cookie->{$value} = 1; |
|
77
|
|
|
|
|
|
|
|
|
78
|
29
|
|
|
|
|
133
|
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; |