You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2022/05/06 01:26:07 UTC

[datasketches-postgresql] 01/02: fixed type

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch quantiles
in repository https://gitbox.apache.org/repos/asf/datasketches-postgresql.git

commit 4c3825d1232840884faa535e33318f8331cfa65c
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Thu May 5 18:24:20 2022 -0700

    fixed type
---
 src/quantiles_double_sketch_pg_functions.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/quantiles_double_sketch_pg_functions.c b/src/quantiles_double_sketch_pg_functions.c
index 6165423..be07b6a 100644
--- a/src/quantiles_double_sketch_pg_functions.c
+++ b/src/quantiles_double_sketch_pg_functions.c
@@ -227,7 +227,7 @@ Datum pg_quantiles_double_sketch_get_pmf(PG_FUNCTION_ARGS) {
 
   split_points = palloc(sizeof(double) * arr_len_in);
   for (i = 0; i < arr_len_in; i++) {
-    split_points[i] = DatumGetFloat4(data_in[i]);
+    split_points[i] = DatumGetFloat8(data_in[i]);
   }
   result = (Datum*) quantiles_double_sketch_get_pmf_or_cdf(sketchptr, split_points, arr_len_in, false, false);
   pfree(split_points);
@@ -277,7 +277,7 @@ Datum pg_quantiles_double_sketch_get_cdf(PG_FUNCTION_ARGS) {
 
   split_points = palloc(sizeof(double) * arr_len_in);
   for (i = 0; i < arr_len_in; i++) {
-    split_points[i] = DatumGetFloat4(data_in[i]);
+    split_points[i] = DatumGetFloat8(data_in[i]);
   }
   result = (Datum*) quantiles_double_sketch_get_pmf_or_cdf(sketchptr, split_points, arr_len_in, true, false);
   pfree(split_points);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org