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

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


The following commit(s) were added to refs/heads/theta by this push:
     new c1fb335  support lg_k in non-aggregate union
c1fb335 is described below

commit c1fb335f9baa1e2e2d870c527a3a88af9f1ae91f
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Tue Jun 11 12:56:52 2019 -0700

    support lg_k in non-aggregate union
---
 src/theta_sketch_pg_functions.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/theta_sketch_pg_functions.c b/src/theta_sketch_pg_functions.c
index 5961c7f..d58b6bb 100644
--- a/src/theta_sketch_pg_functions.c
+++ b/src/theta_sketch_pg_functions.c
@@ -228,8 +228,10 @@ Datum pg_theta_sketch_union(PG_FUNCTION_ARGS) {
   void* unionptr;
   void* sketchptr;
   bytea* bytes_out;
+  int lg_k;
   
-  unionptr = theta_union_new_default();
+  lg_k = PG_GETARG_INT32(2);
+  unionptr = lg_k ? theta_union_new(lg_k) : theta_union_new_default();
   if (!PG_ARGISNULL(0)) {
     bytes_in1 = PG_GETARG_BYTEA_P(0);
     sketchptr1 = theta_sketch_deserialize(VARDATA(bytes_in1), 
VARSIZE(bytes_in1) - VARHDRSZ);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to