Skip to content

Commit 1201693

Browse files
committed
add tests
1 parent bf7bb19 commit 1201693

File tree

8 files changed

+797
-88
lines changed

8 files changed

+797
-88
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- This file is automatically generated. You should know what you did if you want to edit this
2+
-- !bloom_filter --
3+
2 name2 2023-02-02 17:00:00 +08:00
4+

regression-test/data/datatype_p0/timestamptz/test_timestamptz_storage_agg_key.out

Lines changed: 95 additions & 23 deletions
Large diffs are not rendered by default.

regression-test/data/datatype_p0/timestamptz/test_timestamptz_storage_dup_key.out

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,44 @@
143143
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 1
144144
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 1
145145

146+
-- !max_value_all --
147+
\N \N -1
148+
\N 0000-01-01 08:00:00 +08:00 -1
149+
\N 1000-01-01 08:00:00 +08:00 -1
150+
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
151+
0000-01-01 08:00:00 +08:00 9000-01-01 08:00:00 +08:00 0
152+
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
153+
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
154+
2023-02-02 17:00:00 +08:00 9999-12-31 23:59:59 +08:00 2
155+
2023-02-02 17:00:00 +08:00 0000-01-01 05:00:00 +08:00 2
156+
+08:00 \N 9999
157+
158+
-- !multi_key_cols_all --
159+
\N \N 9000-01-01 08:00:00 +08:00 -1
160+
\N \N 0000-01-01 08:00:00 +08:00 -1
161+
\N jack 0000-01-01 08:00:00 +08:00 -2
162+
\N jack 9000-01-01 08:00:00 +08:00 -2
163+
\N rose 9000-01-01 08:00:00 +08:00 -3
164+
\N rose 0000-01-01 08:00:00 +08:00 -3
165+
0000-01-01 08:00:00 +08:00 \N 9000-01-01 08:00:00 +08:00 1
166+
0000-01-01 08:00:00 +08:00 \N 0000-01-01 08:00:00 +08:00 1
167+
0000-01-01 08:00:00 +08:00 jack 0000-01-01 08:00:00 +08:00 2
168+
0000-01-01 08:00:00 +08:00 jack 9000-01-01 08:00:00 +08:00 2
169+
0000-01-01 08:00:00 +08:00 rose 0000-01-01 08:00:00 +08:00 3
170+
0000-01-01 08:00:00 +08:00 rose 9000-01-01 08:00:00 +08:00 3
171+
2023-01-02 04:00:00 +08:00 \N 1000-01-01 08:00:00 +08:00 4
172+
2023-01-02 04:00:00 +08:00 \N 9000-01-01 08:00:00 +08:00 4
173+
2023-01-02 04:00:00 +08:00 jack 9000-01-01 08:00:00 +08:00 5
174+
2023-01-02 04:00:00 +08:00 jack 1000-01-01 08:00:00 +08:00 5
175+
2023-01-02 04:00:00 +08:00 rose 1000-01-01 08:00:00 +08:00 6
176+
2023-01-02 04:00:00 +08:00 rose 9000-01-01 08:00:00 +08:00 6
177+
9999-12-31 23:59:59 +08:00 \N 1999-12-31 23:59:59 +08:00 7
178+
9999-12-31 23:59:59 +08:00 \N 9999-12-31 23:59:59 +08:00 7
179+
9999-12-31 23:59:59 +08:00 jack 9999-12-31 23:59:59 +08:00 8
180+
9999-12-31 23:59:59 +08:00 jack 1999-12-31 23:59:59 +08:00 8
181+
9999-12-31 23:59:59 +08:00 rose 1999-12-31 23:59:59 +08:00 9
182+
9999-12-31 23:59:59 +08:00 rose 9999-12-31 23:59:59 +08:00 9
183+
146184
-- !scale_all --
147185
\N -1
148186
0000-01-01 08:00:00.000001 +08:00 0
@@ -277,3 +315,33 @@
277315
2023-12-12 11:12:12.123461 +08:00 12
278316
2023-12-12 11:12:12.999999 +08:00 13
279317

318+
-- !scale_list_partition0 --
319+
\N -1
320+
2023-01-01 20:00:00.123450 +08:00 1
321+
2023-02-02 20:00:00.123451 +08:00 2
322+
2023-03-03 20:00:00.123452 +08:00 3
323+
2023-04-05 07:59:59.123453 +08:00 4
324+
2023-05-05 08:00:00.123454 +08:00 5
325+
2023-06-06 23:30:30.123455 +08:00 6
326+
2023-07-07 15:07:07.123456 +08:00 7
327+
2023-08-09 04:20:20.123457 +08:00 8
328+
2023-09-09 17:09:09.123458 +08:00 9
329+
2023-10-10 18:10:10.123459 +08:00 10
330+
2023-11-11 19:11:11.123460 +08:00 11
331+
2023-12-12 20:12:12.123461 +08:00 12
332+
333+
-- !scale_list_partition1 --
334+
\N \N -1
335+
2023-01-01 20:00:00.123450 +08:00 jack 1
336+
2023-02-02 20:00:00.123451 +08:00 rose 2
337+
2023-03-03 20:00:00.123452 +08:00 lily 3
338+
2023-04-05 07:59:59.123453 +08:00 tulip 4
339+
2023-05-05 08:00:00.123454 +08:00 daisy 5
340+
2023-06-06 23:30:30.123455 +08:00 sunflower 6
341+
2023-07-07 15:07:07.123456 +08:00 jack 7
342+
2023-08-09 04:20:20.123457 +08:00 rose 8
343+
2023-09-09 17:09:09.123458 +08:00 lily 9
344+
2023-10-10 18:10:10.123459 +08:00 tulip 10
345+
2023-11-11 19:11:11.123460 +08:00 daisy 11
346+
2023-12-12 20:12:12.123461 +08:00 sunflower 12
347+

regression-test/data/datatype_p0/timestamptz/test_timestamptz_storage_uniq_key.out

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
1616
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
1717

18-
-- !select_timestamptz_storage_uniq_key_eq --
18+
-- !eq --
1919
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
2020

21-
-- !select_timestamptz_storage_uniq_key_neq --
21+
-- !neq --
2222
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
2323
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
2424
2023-03-04 01:00:00 +08:00 2023-03-04 01:00:00 +08:00 3
@@ -32,7 +32,7 @@
3232
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
3333
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
3434

35-
-- !select_timestamptz_storage_uniq_key_gt --
35+
-- !gt --
3636
2023-04-05 07:59:59 +08:00 2023-04-05 07:59:59 +08:00 4
3737
2023-05-05 00:00:00 +08:00 2023-05-05 00:00:00 +08:00 5
3838
2023-06-07 01:30:30 +08:00 2023-06-07 01:30:30 +08:00 6
@@ -43,7 +43,7 @@
4343
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
4444
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
4545

46-
-- !select_timestamptz_storage_uniq_key_ge --
46+
-- !ge --
4747
2023-03-04 01:00:00 +08:00 2023-03-04 01:00:00 +08:00 3
4848
2023-04-05 07:59:59 +08:00 2023-04-05 07:59:59 +08:00 4
4949
2023-05-05 00:00:00 +08:00 2023-05-05 00:00:00 +08:00 5
@@ -55,27 +55,27 @@
5555
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
5656
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
5757

58-
-- !select_timestamptz_storage_uniq_key_lt --
58+
-- !lt --
5959
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
6060
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
6161
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
6262
2023-03-04 01:00:00 +08:00 2023-03-04 01:00:00 +08:00 3
6363
2023-04-05 07:59:59 +08:00 2023-04-05 07:59:59 +08:00 4
6464

65-
-- !select_timestamptz_storage_uniq_key_le --
65+
-- !le --
6666
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
6767
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
6868
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
6969
2023-03-04 01:00:00 +08:00 2023-03-04 01:00:00 +08:00 3
7070
2023-04-05 07:59:59 +08:00 2023-04-05 07:59:59 +08:00 4
7171
2023-05-05 00:00:00 +08:00 2023-05-05 00:00:00 +08:00 5
7272

73-
-- !select_timestamptz_storage_uniq_key_in --
73+
-- !in --
7474
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
7575
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
7676
2023-10-10 21:10:10 +08:00 2023-10-10 21:10:10 +08:00 10
7777

78-
-- !select_timestamptz_storage_uniq_key_not_in --
78+
-- !not_in --
7979
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
8080
2023-03-04 01:00:00 +08:00 2023-03-04 01:00:00 +08:00 3
8181
2023-04-05 07:59:59 +08:00 2023-04-05 07:59:59 +08:00 4
@@ -87,10 +87,10 @@
8787
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
8888
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
8989

90-
-- !select_timestamptz_storage_uniq_key_is_null --
90+
-- !is_null --
9191
\N \N -1
9292

93-
-- !select_timestamptz_storage_uniq_key_is_not_null --
93+
-- !is_not_null --
9494
0000-01-01 08:00:00 +08:00 0000-01-01 08:00:00 +08:00 0
9595
2023-01-01 17:00:00 +08:00 2023-01-01 17:00:00 +08:00 1
9696
2023-02-02 17:00:00 +08:00 2023-02-02 17:00:00 +08:00 2
@@ -105,7 +105,21 @@
105105
2023-11-11 19:11:11 +08:00 2023-11-11 19:11:11 +08:00 11
106106
2023-12-12 11:12:12 +08:00 2023-12-12 11:12:12 +08:00 12
107107

108-
-- !select_timestamptz_storage_uniq_key_scale --
108+
-- !multi_key_cols_all0 --
109+
\N \N 0000-01-01 08:00:00 +08:00
110+
\N jack 0000-01-01 08:00:00 +08:00
111+
\N rose 0000-01-01 08:00:00 +08:00
112+
0000-01-01 08:00:00 +08:00 \N 0000-01-01 08:00:00 +08:00
113+
0000-01-01 08:00:00 +08:00 jack 0000-01-01 08:00:00 +08:00
114+
0000-01-01 08:00:00 +08:00 rose 0000-01-01 08:00:00 +08:00
115+
2023-01-02 04:00:00 +08:00 \N 0000-01-01 08:00:00 +08:00
116+
2023-01-02 04:00:00 +08:00 jack 0000-01-01 08:00:00 +08:00
117+
2023-01-02 04:00:00 +08:00 rose 0000-01-01 08:00:00 +08:00
118+
9999-12-31 23:59:59 +08:00 \N 0000-01-01 08:00:00 +08:00
119+
9999-12-31 23:59:59 +08:00 jack 0000-01-01 08:00:00 +08:00
120+
9999-12-31 23:59:59 +08:00 rose 0000-01-01 08:00:00 +08:00
121+
122+
-- !scale --
109123
\N \N -1
110124
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
111125
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
@@ -122,10 +136,10 @@
122136
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
123137
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
124138

125-
-- !select_timestamptz_storage_uniq_key_scale_eq --
139+
-- !scale_eq --
126140
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
127141

128-
-- !select_timestamptz_storage_uniq_key_scale_neq --
142+
-- !scale_neq --
129143
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
130144
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
131145
2023-03-04 01:00:00.123452 +08:00 2023-03-04 01:00:00.123452 +08:00 3
@@ -140,7 +154,7 @@
140154
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
141155
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
142156

143-
-- !select_timestamptz_storage_uniq_key_scale_gt --
157+
-- !scale_gt --
144158
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
145159
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
146160
2023-03-04 01:00:00.123452 +08:00 2023-03-04 01:00:00.123452 +08:00 3
@@ -155,7 +169,7 @@
155169
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
156170
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
157171

158-
-- !select_timestamptz_storage_uniq_key_scale_ge --
172+
-- !scale_ge --
159173
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
160174
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
161175
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
@@ -171,7 +185,7 @@
171185
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
172186
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
173187

174-
-- !select_timestamptz_storage_uniq_key_scale_lt --
188+
-- !scale_lt --
175189
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
176190
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
177191
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
@@ -187,7 +201,7 @@
187201
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
188202
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
189203

190-
-- !select_timestamptz_storage_uniq_key_scale_le --
204+
-- !scale_le --
191205
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
192206
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
193207
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
@@ -202,11 +216,11 @@
202216
2023-11-11 19:11:11.123460 +08:00 2023-11-11 19:11:11.123460 +08:00 11
203217
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
204218

205-
-- !select_timestamptz_storage_uniq_key_scale_in --
219+
-- !scale_in --
206220
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
207221
2023-12-12 11:12:12.123461 +08:00 2023-12-12 11:12:12.123461 +08:00 12
208222

209-
-- !select_timestamptz_storage_uniq_key_scale_not_in --
223+
-- !scale_not_in --
210224
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
211225
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
212226
2023-03-04 01:00:00.123452 +08:00 2023-03-04 01:00:00.123452 +08:00 3
@@ -220,10 +234,10 @@
220234
2023-11-11 19:11:11.123460 +08:00 2023-11-11 19:11:11.123460 +08:00 11
221235
2023-12-12 11:12:12.999999 +08:00 2023-12-12 11:12:12.999999 +08:00 13
222236

223-
-- !select_timestamptz_storage_uniq_key_scale_is_null --
237+
-- !scale_is_null --
224238
\N \N -1
225239

226-
-- !select_timestamptz_storage_uniq_key_scale_is_not_null --
240+
-- !scale_is_not_null --
227241
0000-01-01 08:00:00.000001 +08:00 0000-01-01 08:00:00.000001 +08:00 0
228242
2023-01-01 17:00:00.123450 +08:00 2023-01-01 17:00:00.123450 +08:00 1
229243
2023-02-02 17:00:00.123451 +08:00 2023-02-02 17:00:00.123451 +08:00 2
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
suite("test_timestamptz_bloom_filter") {
19+
sql "set time_zone = '+08:00'; "
20+
21+
sql """
22+
DROP TABLE IF EXISTS `timestamptz_bloom_filter`;
23+
"""
24+
sql """
25+
CREATE TABLE `timestamptz_bloom_filter` (
26+
`id` INT,
27+
`name` VARCHAR(50),
28+
`ts_tz` TIMESTAMPTZ
29+
)
30+
PROPERTIES (
31+
"replication_num" = "1",
32+
"bloom_filter_columns" = "ts_tz"
33+
);
34+
"""
35+
36+
sql """INSERT INTO timestamptz_bloom_filter VALUES
37+
(1, 'name1', '2023-01-01 12:00:00 +03:00'),
38+
(2, 'name2', '2023-02-02 12:00:00 +03:00'),
39+
(3, 'name3', '2023-03-03 12:00:00 -05:00');
40+
"""
41+
42+
qt_bloom_filter """
43+
SELECT * FROM timestamptz_bloom_filter WHERE ts_tz = '2023-02-02 12:00:00 +03:00';
44+
"""
45+
}

0 commit comments

Comments
 (0)