This is an automated email from the ASF dual-hosted git repository.
alsay pushed a commit to branch tuple_sketch_int64
in repository https://gitbox.apache.org/repos/asf/datasketches-bigquery.git
The following commit(s) were added to refs/heads/tuple_sketch_int64 by this
push:
new a73e2fc a_not_b with default seed
a73e2fc is described below
commit a73e2fcd61a5b573abdf65059268425001e94653
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Thu Sep 12 22:11:11 2024 -0700
a_not_b with default seed
---
tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx | 26 ++++++++++++++++++++++++++
tuple/test/tuple_sketch_int_test.sql | 17 +++++++++++++----
2 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
b/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
new file mode 100644
index 0000000..8480636
--- /dev/null
+++ b/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+config { hasOutput: true }
+
+CREATE OR REPLACE FUNCTION ${self()}(sketchA BYTES, sketchB BYTES)
+RETURNS BYTES
+AS (
+ $BQ_DATASET.tuple_sketch_int64_a_not_b_seed(sketchA, sketchB, NULL)
+);
diff --git a/tuple/test/tuple_sketch_int_test.sql
b/tuple/test/tuple_sketch_int_test.sql
index 293de0d..f30836b 100644
--- a/tuple/test/tuple_sketch_int_test.sql
+++ b/tuple/test/tuple_sketch_int_test.sql
@@ -78,14 +78,23 @@ select $BQ_DATASET.tuple_sketch_int64_get_estimate_seed(
111
);
+# expected 2
+select $BQ_DATASET.tuple_sketch_int64_get_estimate(
+ $BQ_DATASET.tuple_sketch_int64_a_not_b(
+ (select $BQ_DATASET.tuple_sketch_int64_agg_string(str, 1) from
unnest(["a", "b", "c"]) as str),
+ (select $BQ_DATASET.tuple_sketch_int64_agg_string(str, 1) from
unnest(["c", "d", "e"]) as str)
+ )
+);
+
+# full signatures
# expected 2
select $BQ_DATASET.tuple_sketch_int64_get_estimate_seed(
$BQ_DATASET.tuple_sketch_int64_a_not_b_seed(
- (select $BQ_DATASET.tuple_sketch_int64_agg_string(str, 1) from
unnest(["a", "b", "c"]) as str),
- (select $BQ_DATASET.tuple_sketch_int64_agg_string(str, 1) from
unnest(["c", "d", "e"]) as str),
- null
+ (select $BQ_DATASET.tuple_sketch_int64_agg_string_lgk_seed_p_mode(str, 1,
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(10, 111, 0.999, "MIN")) from
unnest(["a", "b", "c"]) as str),
+ (select $BQ_DATASET.tuple_sketch_int64_agg_string_lgk_seed_p_mode(str, 1,
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(10, 111, 0.999, "MIN")) from
unnest(["c", "d", "e"]) as str),
+ 111
),
- null
+ 111
);
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]