Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4256bd

Browse files
committed
Fixes for wnidow functions
1 parent719cc49 commitd4256bd

File tree

6 files changed

+594
-224
lines changed

6 files changed

+594
-224
lines changed

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OBJS = vops.o
66
EXTENSION = vops
77
DATA = vops--1.0.sql
88
PGFILEDESC = "vops - vectorized operations"
9-
CUSTOM_COPT = -O3
9+
CUSTOM_COPT = -O0 -g
1010

1111
REGRESS = test
1212

‎expected/test.out‎

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,250 @@ select unnest(t.*) from (select mcount(*) over w,mcount(x) over w,msum(x) over w
140140
(64 rows)
141141

142142

143+
create table s2(x float8, id serial);
144+
insert into s2(select generate_series(1,100));
145+
create table v2(x vops_float8, id vops_int4);
146+
select populate(destination:='v2'::regclass, source:='s2'::regclass,sort:='id');
147+
populate
148+
----------
149+
100
150+
(1 row)
151+
152+
select unnest(t.*) from (select msum(x,10) over (order by first(id)) from v2) t;
153+
unnest
154+
--------
155+
(1)
156+
(3)
157+
(6)
158+
(10)
159+
(15)
160+
(21)
161+
(28)
162+
(36)
163+
(45)
164+
(55)
165+
(65)
166+
(75)
167+
(85)
168+
(95)
169+
(105)
170+
(115)
171+
(125)
172+
(135)
173+
(145)
174+
(155)
175+
(165)
176+
(175)
177+
(185)
178+
(195)
179+
(205)
180+
(215)
181+
(225)
182+
(235)
183+
(245)
184+
(255)
185+
(265)
186+
(275)
187+
(285)
188+
(295)
189+
(305)
190+
(315)
191+
(325)
192+
(335)
193+
(345)
194+
(355)
195+
(365)
196+
(375)
197+
(385)
198+
(395)
199+
(405)
200+
(415)
201+
(425)
202+
(435)
203+
(445)
204+
(455)
205+
(465)
206+
(475)
207+
(485)
208+
(495)
209+
(505)
210+
(515)
211+
(525)
212+
(535)
213+
(545)
214+
(555)
215+
(565)
216+
(575)
217+
(585)
218+
(595)
219+
(605)
220+
(615)
221+
(625)
222+
(635)
223+
(645)
224+
(655)
225+
(665)
226+
(675)
227+
(685)
228+
(695)
229+
(705)
230+
(715)
231+
(725)
232+
(735)
233+
(745)
234+
(755)
235+
(765)
236+
(775)
237+
(785)
238+
(795)
239+
(805)
240+
(815)
241+
(825)
242+
(835)
243+
(845)
244+
(855)
245+
(865)
246+
(875)
247+
(885)
248+
(895)
249+
(905)
250+
(915)
251+
(925)
252+
(935)
253+
(945)
254+
(955)
255+
(864)
256+
(772)
257+
(679)
258+
(585)
259+
(490)
260+
(394)
261+
(297)
262+
(199)
263+
(100)
264+
(0)
265+
(0)
266+
(0)
267+
(0)
268+
(0)
269+
(0)
270+
(0)
271+
(0)
272+
(0)
273+
(0)
274+
(0)
275+
(0)
276+
(0)
277+
(0)
278+
(0)
279+
(0)
280+
(0)
281+
(0)
282+
(0)
283+
(128 rows)
284+
285+
select sum(x) over (order by id rows between 9 preceding and current row) from s2;
286+
sum
287+
-----
288+
1
289+
3
290+
6
291+
10
292+
15
293+
21
294+
28
295+
36
296+
45
297+
55
298+
65
299+
75
300+
85
301+
95
302+
105
303+
115
304+
125
305+
135
306+
145
307+
155
308+
165
309+
175
310+
185
311+
195
312+
205
313+
215
314+
225
315+
235
316+
245
317+
255
318+
265
319+
275
320+
285
321+
295
322+
305
323+
315
324+
325
325+
335
326+
345
327+
355
328+
365
329+
375
330+
385
331+
395
332+
405
333+
415
334+
425
335+
435
336+
445
337+
455
338+
465
339+
475
340+
485
341+
495
342+
505
343+
515
344+
525
345+
535
346+
545
347+
555
348+
565
349+
575
350+
585
351+
595
352+
605
353+
615
354+
625
355+
635
356+
645
357+
655
358+
665
359+
675
360+
685
361+
695
362+
705
363+
715
364+
725
365+
735
366+
745
367+
755
368+
765
369+
775
370+
785
371+
795
372+
805
373+
815
374+
825
375+
835
376+
845
377+
855
378+
865
379+
875
380+
885
381+
895
382+
905
383+
915
384+
925
385+
935
386+
945
387+
955
388+
(100 rows)
389+

‎sql/test.sql‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ select count(*) from v where ifnull(x, 0) >= 0;
1515
selectcount(*)from vwhere coalesce(x,0.0::float8::vops_float4)>=0;
1616
select unnest(t.*)from (select mcount(*) over w,mcount(x) over w,msum(x) over w,mavg(x) over w,mmin(x) over w,mmax(x) over w,x- lag(x) over wfrom v window was (rows between unbounded precedingand current row)) t;
1717

18+
createtables2(x float8, idserial);
19+
insert into s2(select generate_series(1,100));
20+
createtablev2(x vops_float8, id vops_int4);
21+
select populate(destination:='v2'::regclass, source:='s2'::regclass,sort:='id');
22+
23+
select unnest(t.*)from (select msum(x,10) over (order by first(id))from v2) t;
24+
selectsum(x) over (order by id rows between9 precedingand current row)from s2;
25+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp