Skip to content

Commit 1fd706c

Browse files
committed
Invert STDEV and STDEVP as they are the default in Crate is STDEVP
1 parent 7becd16 commit 1fd706c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cratedb_jdbc/dialect.tdd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,13 +726,12 @@
726726
<argument type='date'/>
727727
</function>
728728
<function group='aggregate' name='STDEV' return-type='real'>
729-
<formula>STDDEV(%1)</formula>
729+
<formula>STDDEV(%1) * sqrt(count(%1) / (count(%1) - 1.0))</formula>
730730
<unagg-formula>NULL</unagg-formula>
731731
<argument type='real'/>
732732
</function>
733733
<function group='aggregate' name='STDEVP' return-type='real'>
734-
<formula>(CASE WHEN COUNT(%1) = 1 THEN 0.0 WHEN COUNT(%1) &gt; 0 THEN (STDDEV(%1) * SQRT(COUNT(%1) - 1) /
735-
SQRT(COUNT(%1)) ) ELSE NULL END)
734+
<formula>(CASE WHEN COUNT(%1) = 1 THEN 0.0 WHEN COUNT(%1) &gt; 0 THEN STDDEV(%1) ELSE NULL END)
736735
</formula>
737736
<unagg-formula>(CASE WHEN %1 IS NULL THEN NULL ELSE 0.0 END)</unagg-formula>
738737
<argument type='real'/>

0 commit comments

Comments
 (0)