Skip to content

Commit 9830034

Browse files
authored
change count() return type to int64 (#6466)
1 parent 3c25564 commit 9830034

File tree

88 files changed

+294
-294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+294
-294
lines changed

book/src/database/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ curl -X POST \
414414
**Example Response**
415415

416416
```
417-
{warehouse:"chicago",count:2::uint64}
418-
{warehouse:"miami",count:1::uint64}
417+
{warehouse:"chicago",count:2}
418+
{warehouse:"miami",count:1}
419419
```
420420

421421
**Example Request**
@@ -431,7 +431,7 @@ curl -X POST \
431431

432432
```
433433
{"type":"QueryChannelSet","value":{"channel":"main"}}
434-
{"type":{"kind":"record","id":30,"fields":[{"name":"warehouse","type":{"kind":"primitive","name":"string"}},{"name":"count","type":{"kind":"primitive","name":"uint64"}}]},"value":["miami","1"]}
434+
{"type":{"kind":"record","id":30,"fields":[{"name":"warehouse","type":{"kind":"primitive","name":"string"}},{"name":"count","type":{"kind":"primitive","name":"int64"}}]},"value":["miami","1"]}
435435
{"type":{"kind":"ref","id":30},"value":["chicago","2"]}
436436
{"type":"QueryChannelEnd","value":{"channel":"main"}}
437437
{"type":"QueryStats","value":{"start_time":{"sec":1658193276,"ns":964207000},"update_time":{"sec":1658193276,"ns":964592000},"bytes_read":55,"bytes_matched":55,"records_read":3,"records_matched":3}}

book/src/dev/integrations/fluentd.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,12 @@ super db -c 'from "zeek-shaped" | _path=="conn" | cidr_match(172.31.0.0/16, id.r
309309
which in our test environment produced
310310

311311
```
312-
{id:{orig_h:218.92.0.99,orig_p:9090::(port=uint16),resp_h:172.31.0.253,resp_p:22(port)}(=conn_id),count:4::uint64}
313-
{id:{orig_h:172.31.0.253,orig_p:42014::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1::uint64}
314-
{id:{orig_h:172.31.0.253,orig_p:37490::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1::uint64}
315-
{id:{orig_h:172.31.0.253,orig_p:33488::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1::uint64}
316-
{id:{orig_h:172.31.0.253,orig_p:44362::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1::uint64}
317-
{id:{orig_h:199.83.220.79,orig_p:52876::(port=uint16),resp_h:172.31.0.253,resp_p:22(port)}(=conn_id),count:1::uint64}
312+
{id:{orig_h:218.92.0.99,orig_p:9090::(port=uint16),resp_h:172.31.0.253,resp_p:22(port)}(=conn_id),count:4}
313+
{id:{orig_h:172.31.0.253,orig_p:42014::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1}
314+
{id:{orig_h:172.31.0.253,orig_p:37490::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1}
315+
{id:{orig_h:172.31.0.253,orig_p:33488::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1}
316+
{id:{orig_h:172.31.0.253,orig_p:44362::(port=uint16),resp_h:172.31.0.2,resp_p:53(port)}(=conn_id),count:1}
317+
{id:{orig_h:199.83.220.79,orig_p:52876::(port=uint16),resp_h:172.31.0.253,resp_p:22(port)}(=conn_id),count:1}
318318
```
319319

320320
or this query that counts events into buckets by `time` span
@@ -326,12 +326,12 @@ super db -c 'from "zeek-shaped" | count() by bucket(ts,5m) | sort bucket'
326326
which in our test environment produced
327327

328328
```
329-
{bucket:2024-07-19T22:15:00Z,count:1::uint64}
330-
{bucket:2024-07-19T22:45:00Z,count:6::uint64}
331-
{bucket:2024-07-19T22:50:00Z,count:696::uint64}
332-
{bucket:2024-07-19T22:55:00Z,count:683::uint64}
333-
{bucket:2024-07-19T23:00:00Z,count:698::uint64}
334-
{bucket:2024-07-19T23:05:00Z,count:309::uint64}
329+
{bucket:2024-07-19T22:15:00Z,count:1}
330+
{bucket:2024-07-19T22:45:00Z,count:6}
331+
{bucket:2024-07-19T22:50:00Z,count:696}
332+
{bucket:2024-07-19T22:55:00Z,count:683}
333+
{bucket:2024-07-19T23:00:00Z,count:698}
334+
{bucket:2024-07-19T23:05:00Z,count:309}
335335
```
336336

337337
## SuperDB Database Maintenance

book/src/super-sql/aggregates/count.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
### Synopsis
99
```
10-
count() -> uint64
10+
count() -> int64
1111
```
1212

1313
### Description
@@ -25,7 +25,7 @@ count()
2525
2
2626
3
2727
# expected output
28-
3::uint64
28+
3
2929
```
3030

3131
Mixed types are handled:
@@ -37,7 +37,7 @@ count()
3737
"foo"
3838
10.0.0.1
3939
# expected output
40-
3::uint64
40+
3
4141
```
4242

4343
Count of values in buckets grouped by key:
@@ -49,8 +49,8 @@ count() by k | sort
4949
{a:2,k:1}
5050
{a:3,k:2}
5151
# expected output
52-
{k:1,count:2::uint64}
53-
{k:2,count:1::uint64}
52+
{k:1,count:2}
53+
{k:2,count:1}
5454
```
5555

5656
A simple count with no input values returns no output:
@@ -73,7 +73,7 @@ count() filter (grep("bar", this))
7373
"foo"
7474
10.0.0.1
7575
# expected output
76-
0::uint64
76+
0
7777
```
7878

7979
Note that the number of input values are counted, unlike the
@@ -85,5 +85,5 @@ count()
8585
# input
8686
[1,2,3]
8787
# expected output
88-
1::uint64
88+
1
8989
```

book/src/super-sql/expressions/subqueries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ values 3,4
6767
evaluates the subquery `from input | count()` just once and materializes the result.
6868
Then, for each input value `3` and `4`, the result is emitted, e.g.,
6969
```
70-
{that:3,count:3::uint64}
71-
{that:4,count:3::uint64}
70+
{that:3,count:3}
71+
{that:4,count:3}
7272
```
7373

7474
### Correlated Subqueries

book/src/super-sql/operators/aggregate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ aggregate avg(this),sum(this),count()
115115
3
116116
4
117117
# expected output
118-
{avg:2.5,sum:10,count:4::uint64}
118+
{avg:2.5,sum:10,count:4}
119119
```
120120

121121
---

book/src/super-sql/operators/top.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ count() by name | top -r 2 count
5959
{name:"sue", age:41}
6060
{name:"liz", age:60}
6161
# expected output
62-
{name:"liz",count:3::uint64}
63-
{name:"bob",count:2::uint64}
62+
{name:"liz",count:3}
63+
{name:"bob",count:2}
6464
```

book/src/super-sql/types/named.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ count() by typeof(this) | sort this
107107
"hello"::=foo
108108
3::=foo
109109
# expected output
110-
{typeof:<bar=int64>,count:1::uint64}
111-
{typeof:<foo=int64>,count:2::uint64}
112-
{typeof:<foo=string>,count:1::uint64}
110+
{typeof:<bar=int64>,count:1}
111+
{typeof:<foo=int64>,count:2}
112+
{typeof:<foo=string>,count:1}
113113
```

book/src/super-sql/types/type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ count() by typeof(this) | sort this
9393
10.0.0.1
9494
<string>
9595
# expected output
96-
{typeof:<int64>,count:2::uint64}
97-
{typeof:<string>,count:1::uint64}
98-
{typeof:<ip>,count:1::uint64}
99-
{typeof:<type>,count:1::uint64}
96+
{typeof:<int64>,count:2}
97+
{typeof:<string>,count:1}
98+
{typeof:<ip>,count:1}
99+
{typeof:<type>,count:1}
100100
```

book/src/tutorials/jq.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ super -s -c 'unnest this | count() by kind(this)' prs.json
668668
```
669669
produces
670670
```mdtest-output
671-
{kind:"record",count:30::uint64}
671+
{kind:"record",count:30}
672672
```
673673
Ok, they're all records. Good, this should be easy!
674674

@@ -692,7 +692,7 @@ super -s -c 'unnest this | shapes | count()' prs.json
692692
```
693693
produces
694694
```mdtest-output
695-
3::uint64
695+
3
696696
```
697697
All that data across the samples and only three shapes.
698698
They must each be really big. Let's check that out.
@@ -854,8 +854,8 @@ super -s -c 'sample | count()' prs1.bsup
854854
```
855855
produces
856856
```
857-
{count:28::uint64}
858-
{count:1::uint64}
857+
{count:28}
858+
{count:1}
859859
```
860860
Okay, good. There are 28 values (the 30 requested less the two empty records)
861861
and exactly one shape since the data was fused.
@@ -1018,11 +1018,11 @@ super -s -c "count() by user:=user.login | sort count desc" prs.bsup
10181018
```
10191019
produces
10201020
```mdtest-output
1021-
{user:"mattnibs",count:10::uint64}
1022-
{user:"aswan",count:7::uint64}
1023-
{user:"mccanne",count:6::uint64}
1024-
{user:"nwt",count:4::uint64}
1025-
{user:"henridf",count:1::uint64}
1021+
{user:"mattnibs",count:10}
1022+
{user:"aswan",count:7}
1023+
{user:"mccanne",count:6}
1024+
{user:"nwt",count:4}
1025+
{user:"henridf",count:1}
10261026
```
10271027
How about getting a list of all of the reviewers? To do this, we need to
10281028
traverse the records in the `requested_reviewers` array and collect up

book/src/tutorials/performance.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ WHERE grep('in case you have any feedback 😊', payload.pull_request.body)
527527
528528
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'super -s -I /mnt/tmpdir/tmp.pDeSZCTa2V'
529529
Benchmark 1: super -s -I /mnt/tmpdir/tmp.pDeSZCTa2V
530-
{count:2::uint64}
530+
{count:2}
531531
Time (abs ≡): 6.371 s [User: 23.178 s, System: 1.700 s]
532532
533533
About to execute
@@ -542,7 +542,7 @@ WHERE grep('in case you have any feedback 😊', payload.pull_request.body)
542542
543543
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.AYZIh6yi2s'
544544
Benchmark 1: SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.AYZIh6yi2s
545-
{count:2::uint64}
545+
{count:2}
546546
Time (abs ≡): 40.838 s [User: 292.674 s, System: 18.797 s]
547547
```
548548
### Search+ Test
@@ -673,7 +673,7 @@ WHERE grep('in case you have any feedback 😊')
673673
674674
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'super -s -I /mnt/tmpdir/tmp.jJSibCjp8r'
675675
Benchmark 1: super -s -I /mnt/tmpdir/tmp.jJSibCjp8r
676-
{count:3::uint64}
676+
{count:3}
677677
Time (abs ≡): 12.492 s [User: 88.901 s, System: 1.672 s]
678678
679679
About to execute
@@ -688,7 +688,7 @@ WHERE grep('in case you have any feedback 😊')
688688
689689
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.evXq1mxkI0'
690690
Benchmark 1: SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.evXq1mxkI0
691-
{count:3::uint64}
691+
{count:3}
692692
Time (abs ≡): 55.081 s [User: 408.337 s, System: 18.597 s]
693693
```
694694

@@ -800,7 +800,7 @@ WHERE actor.login='johnbieren'
800800
801801
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'super -s -I /mnt/tmpdir/tmp.AbeKpBbYW8'
802802
Benchmark 1: super -s -I /mnt/tmpdir/tmp.AbeKpBbYW8
803-
{count:879::uint64}
803+
{count:879}
804804
Time (abs ≡): 5.786 s [User: 17.405 s, System: 1.637 s]
805805
806806
About to execute
@@ -815,7 +815,7 @@ WHERE actor.login='johnbieren'
815815
816816
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.5xTnB02WgG'
817817
Benchmark 1: SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.5xTnB02WgG
818-
{count:879::uint64}
818+
{count:879}
819819
Time (abs ≡): 0.303 s [User: 0.792 s, System: 0.240 s]
820820
```
821821

@@ -969,14 +969,14 @@ GROUP BY type
969969
970970
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'super -s -I /mnt/tmpdir/tmp.QMhaBvUi2y'
971971
Benchmark 1: super -s -I /mnt/tmpdir/tmp.QMhaBvUi2y
972-
{type:"PullRequestReviewCommentEvent",count:7::uint64}
973-
{type:"PullRequestReviewEvent",count:14::uint64}
974-
{type:"IssueCommentEvent",count:30::uint64}
975-
{type:"WatchEvent",count:29::uint64}
976-
{type:"PullRequestEvent",count:35::uint64}
977-
{type:"PushEvent",count:15::uint64}
978-
{type:"IssuesEvent",count:9::uint64}
979-
{type:"ForkEvent",count:3::uint64}
972+
{type:"PullRequestReviewCommentEvent",count:7}
973+
{type:"PullRequestReviewEvent",count:14}
974+
{type:"IssueCommentEvent",count:30}
975+
{type:"WatchEvent",count:29}
976+
{type:"PullRequestEvent",count:35}
977+
{type:"PushEvent",count:15}
978+
{type:"IssuesEvent",count:9}
979+
{type:"ForkEvent",count:3}
980980
Time (abs ≡): 5.626 s [User: 15.509 s, System: 1.552 s]
981981
982982
About to execute
@@ -992,14 +992,14 @@ GROUP BY type
992992
993993
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.yfAdMeskPR'
994994
Benchmark 1: SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.yfAdMeskPR
995-
{type:"PushEvent",count:15::uint64}
996-
{type:"IssuesEvent",count:9::uint64}
997-
{type:"WatchEvent",count:29::uint64}
998-
{type:"PullRequestEvent",count:35::uint64}
999-
{type:"ForkEvent",count:3::uint64}
1000-
{type:"PullRequestReviewCommentEvent",count:7::uint64}
1001-
{type:"PullRequestReviewEvent",count:14::uint64}
1002-
{type:"IssueCommentEvent",count:30::uint64}
995+
{type:"PushEvent",count:15}
996+
{type:"IssuesEvent",count:9}
997+
{type:"WatchEvent",count:29}
998+
{type:"PullRequestEvent",count:35}
999+
{type:"ForkEvent",count:3}
1000+
{type:"PullRequestReviewCommentEvent",count:7}
1001+
{type:"PullRequestReviewEvent",count:14}
1002+
{type:"IssueCommentEvent",count:30}
10031003
Time (abs ≡): 0.491 s [User: 2.049 s, System: 0.357 s]
10041004
```
10051005

@@ -1157,11 +1157,11 @@ FROM '/mnt/gha.bsup'
11571157
11581158
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'super -s -I /mnt/tmpdir/tmp.JzRx6IABuv'
11591159
Benchmark 1: super -s -I /mnt/tmpdir/tmp.JzRx6IABuv
1160-
{assignee:"poad",count:1966::uint64}
1161-
{assignee:"vinayakkulkarni",count:508::uint64}
1162-
{assignee:"tmtmtmtm",count:356::uint64}
1163-
{assignee:"AMatutat",count:260::uint64}
1164-
{assignee:"danwinship",count:208::uint64}
1160+
{assignee:"poad",count:1966}
1161+
{assignee:"vinayakkulkarni",count:508}
1162+
{assignee:"tmtmtmtm",count:356}
1163+
{assignee:"AMatutat",count:260}
1164+
{assignee:"danwinship",count:208}
11651165
Time (abs ≡): 8.245 s [User: 17.489 s, System: 1.938 s]
11661166
11671167
About to execute
@@ -1179,10 +1179,10 @@ FROM '/mnt/gha.parquet'
11791179
11801180
+ hyperfine --show-output --warmup 1 --runs 1 --time-unit second 'SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.djiUKncZ0T'
11811181
Benchmark 1: SUPER_VAM=1 super -s -I /mnt/tmpdir/tmp.djiUKncZ0T
1182-
{assignee:"poad",count:1966::uint64}
1183-
{assignee:"vinayakkulkarni",count:508::uint64}
1184-
{assignee:"tmtmtmtm",count:356::uint64}
1185-
{assignee:"AMatutat",count:260::uint64}
1186-
{assignee:"danwinship",count:208::uint64}
1182+
{assignee:"poad",count:1966}
1183+
{assignee:"vinayakkulkarni",count:508}
1184+
{assignee:"tmtmtmtm",count:356}
1185+
{assignee:"AMatutat",count:260}
1186+
{assignee:"danwinship",count:208}
11871187
Time (abs ≡): 40.014 s [User: 291.269 s, System: 17.516 s]
11881188
```

0 commit comments

Comments
 (0)