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

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

commit 49c6766165de9daee21af0bf1de987002a26a1e0
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Tue Oct 15 20:02:11 2024 -0700

    use ref()
---
 README.md                                                      | 3 ++-
 cpc/sqlx/cpc_sketch_agg_int64.sqlx                             | 2 +-
 cpc/sqlx/cpc_sketch_agg_string.sqlx                            | 2 +-
 cpc/sqlx/cpc_sketch_agg_union.sqlx                             | 2 +-
 cpc/sqlx/cpc_sketch_get_estimate.sqlx                          | 2 +-
 cpc/sqlx/cpc_sketch_get_estimate_and_bounds.sqlx               | 2 +-
 cpc/sqlx/cpc_sketch_to_string.sqlx                             | 2 +-
 cpc/sqlx/cpc_sketch_union.sqlx                                 | 2 +-
 hll/sqlx/hll_sketch_agg_int64.sqlx                             | 2 +-
 hll/sqlx/hll_sketch_agg_string.sqlx                            | 2 +-
 hll/sqlx/hll_sketch_agg_union.sqlx                             | 2 +-
 hll/sqlx/hll_sketch_union.sqlx                                 | 2 +-
 substitute_and_run.sh                                          | 6 +++++-
 theta/sqlx/theta_sketch_a_not_b.sqlx                           | 2 +-
 theta/sqlx/theta_sketch_agg_int64.sqlx                         | 2 +-
 theta/sqlx/theta_sketch_agg_string.sqlx                        | 2 +-
 theta/sqlx/theta_sketch_agg_union.sqlx                         | 2 +-
 theta/sqlx/theta_sketch_get_estimate.sqlx                      | 2 +-
 theta/sqlx/theta_sketch_get_estimate_and_bounds.sqlx           | 2 +-
 theta/sqlx/theta_sketch_get_num_retained.sqlx                  | 2 +-
 theta/sqlx/theta_sketch_get_theta.sqlx                         | 2 +-
 theta/sqlx/theta_sketch_intersection.sqlx                      | 2 +-
 theta/sqlx/theta_sketch_jaccard_similarity.sqlx                | 2 +-
 theta/sqlx/theta_sketch_to_string.sqlx                         | 2 +-
 theta/sqlx/theta_sketch_union.sqlx                             | 2 +-
 tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx                     | 2 +-
 tuple/sqlx/tuple_sketch_int64_agg_int64.sqlx                   | 2 +-
 tuple/sqlx/tuple_sketch_int64_agg_string.sqlx                  | 2 +-
 tuple/sqlx/tuple_sketch_int64_agg_union.sqlx                   | 2 +-
 tuple/sqlx/tuple_sketch_int64_filter_low_high.sqlx             | 2 +-
 tuple/sqlx/tuple_sketch_int64_from_theta_sketch.sqlx           | 2 +-
 tuple/sqlx/tuple_sketch_int64_get_estimate.sqlx                | 2 +-
 tuple/sqlx/tuple_sketch_int64_get_estimate_and_bounds.sqlx     | 2 +-
 tuple/sqlx/tuple_sketch_int64_get_num_retained.sqlx            | 2 +-
 tuple/sqlx/tuple_sketch_int64_get_sum_estimate_and_bounds.sqlx | 2 +-
 tuple/sqlx/tuple_sketch_int64_get_theta.sqlx                   | 2 +-
 tuple/sqlx/tuple_sketch_int64_intersection.sqlx                | 2 +-
 tuple/sqlx/tuple_sketch_int64_jaccard_similarity.sqlx          | 2 +-
 tuple/sqlx/tuple_sketch_int64_to_string.sqlx                   | 2 +-
 tuple/sqlx/tuple_sketch_int64_union.sqlx                       | 2 +-
 40 files changed, 45 insertions(+), 40 deletions(-)

diff --git a/README.md b/README.md
index 59d0714..3181270 100644
--- a/README.md
+++ b/README.md
@@ -42,11 +42,12 @@ page for how to contact us.
 
 - Requires setting environment variables 
     - GCS_BUCKET: to hold compiled artifacts
+    - BQ_PROJECT: location of stored SQL functions (routines)
     - BQ_DATASET: location of stored SQL functions (routines)
 
 ```
 make          # performs compilation
-make install  # upload to $GCS_BUCKET & create functions in $BQ_DATASET
+make install  # upload to $GCS_BUCKET & create functions in 
$BQ_PROJECT.$BQ_DATASET
 make test     # runs predefined tests in BQ
 ```
 
diff --git a/cpc/sqlx/cpc_sketch_agg_int64.sqlx 
b/cpc/sqlx/cpc_sketch_agg_int64.sqlx
index b2dd385..d3ab550 100644
--- a/cpc/sqlx/cpc_sketch_agg_int64.sqlx
+++ b/cpc/sqlx/cpc_sketch_agg_int64.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_agg_int64_lgk_seed(value, STRUCT<BYTEINT, 
INT64>(NULL, NULL))
+  ${ref("cpc_sketch_agg_int64_lgk_seed")}(value, STRUCT<BYTEINT, INT64>(NULL, 
NULL))
 );
diff --git a/cpc/sqlx/cpc_sketch_agg_string.sqlx 
b/cpc/sqlx/cpc_sketch_agg_string.sqlx
index b773a19..dbb19f9 100644
--- a/cpc/sqlx/cpc_sketch_agg_string.sqlx
+++ b/cpc/sqlx/cpc_sketch_agg_string.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_agg_string_lgk_seed(str, STRUCT<BYTEINT, INT64>(NULL, 
NULL))
+  ${ref("cpc_sketch_agg_string_lgk_seed")}(str, STRUCT<BYTEINT, INT64>(NULL, 
NULL))
 );
diff --git a/cpc/sqlx/cpc_sketch_agg_union.sqlx 
b/cpc/sqlx/cpc_sketch_agg_union.sqlx
index af679a3..fc3c88a 100644
--- a/cpc/sqlx/cpc_sketch_agg_union.sqlx
+++ b/cpc/sqlx/cpc_sketch_agg_union.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_agg_union_lgk_seed(sketch, STRUCT<BYTEINT, 
INT64>(NULL, NULL))
+  ${ref("cpc_sketch_agg_union_lgk_seed")}(sketch, STRUCT<BYTEINT, INT64>(NULL, 
NULL))
 );
diff --git a/cpc/sqlx/cpc_sketch_get_estimate.sqlx 
b/cpc/sqlx/cpc_sketch_get_estimate.sqlx
index 9a77467..184f613 100644
--- a/cpc/sqlx/cpc_sketch_get_estimate.sqlx
+++ b/cpc/sqlx/cpc_sketch_get_estimate.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_get_estimate_seed(sketch, NULL)
+  ${ref("cpc_sketch_get_estimate_seed")}(sketch, NULL)
 );
diff --git a/cpc/sqlx/cpc_sketch_get_estimate_and_bounds.sqlx 
b/cpc/sqlx/cpc_sketch_get_estimate_and_bounds.sqlx
index ba8b214..466bb22 100644
--- a/cpc/sqlx/cpc_sketch_get_estimate_and_bounds.sqlx
+++ b/cpc/sqlx/cpc_sketch_get_estimate_and_bounds.sqlx
@@ -35,5 +35,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_get_estimate_and_bounds_seed(sketch, num_std_devs, 
NULL)
+  ${ref("cpc_sketch_get_estimate_and_bounds_seed")}(sketch, num_std_devs, NULL)
 );
diff --git a/cpc/sqlx/cpc_sketch_to_string.sqlx 
b/cpc/sqlx/cpc_sketch_to_string.sqlx
index 83014e2..c885b14 100644
--- a/cpc/sqlx/cpc_sketch_to_string.sqlx
+++ b/cpc/sqlx/cpc_sketch_to_string.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_to_string_seed(sketch, NULL)
+  ${ref("cpc_sketch_to_string_seed")}(sketch, NULL)
 );
diff --git a/cpc/sqlx/cpc_sketch_union.sqlx b/cpc/sqlx/cpc_sketch_union.sqlx
index 53e135c..1a44f39 100644
--- a/cpc/sqlx/cpc_sketch_union.sqlx
+++ b/cpc/sqlx/cpc_sketch_union.sqlx
@@ -33,5 +33,5 @@ For more information:
  - https://datasketches.apache.org/docs/CPC/CpcSketches.html
 '''
 ) AS (
-  $BQ_DATASET.cpc_sketch_union_lgk_seed(sketchA, sketchB, NULL, NULL)
+  ${ref("cpc_sketch_union_lgk_seed")}(sketchA, sketchB, NULL, NULL)
 );
diff --git a/hll/sqlx/hll_sketch_agg_int64.sqlx 
b/hll/sqlx/hll_sketch_agg_int64.sqlx
index ee1956d..6a02f00 100644
--- a/hll/sqlx/hll_sketch_agg_int64.sqlx
+++ b/hll/sqlx/hll_sketch_agg_int64.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/HLL/HllSketches.html
 '''
 ) AS (
-  $BQ_DATASET.hll_sketch_agg_int64_lgk_type(value, STRUCT<BYTEINT, 
STRING>(NULL, NULL))
+  ${ref("hll_sketch_agg_int64_lgk_type")}(value, STRUCT<BYTEINT, STRING>(NULL, 
NULL))
 );
diff --git a/hll/sqlx/hll_sketch_agg_string.sqlx 
b/hll/sqlx/hll_sketch_agg_string.sqlx
index c3023a7..36f637e 100644
--- a/hll/sqlx/hll_sketch_agg_string.sqlx
+++ b/hll/sqlx/hll_sketch_agg_string.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/HLL/HllSketches.html
 '''
 ) AS (
-  $BQ_DATASET.hll_sketch_agg_string_lgk_type(str, STRUCT<BYTEINT, 
STRING>(NULL, NULL))
+  ${ref("hll_sketch_agg_string_lgk_type")}(str, STRUCT<BYTEINT, STRING>(NULL, 
NULL))
 );
diff --git a/hll/sqlx/hll_sketch_agg_union.sqlx 
b/hll/sqlx/hll_sketch_agg_union.sqlx
index bd06eb9..ed33b11 100644
--- a/hll/sqlx/hll_sketch_agg_union.sqlx
+++ b/hll/sqlx/hll_sketch_agg_union.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/HLL/HllSketches.html
 '''
 ) AS (
-  $BQ_DATASET.hll_sketch_agg_union_lgk_type(sketch, STRUCT<BYTEINT, 
STRING>(NULL, NULL))
+  ${ref("hll_sketch_agg_union_lgk_type")}(sketch, STRUCT<BYTEINT, 
STRING>(NULL, NULL))
 );
diff --git a/hll/sqlx/hll_sketch_union.sqlx b/hll/sqlx/hll_sketch_union.sqlx
index 5d6839b..47b151f 100644
--- a/hll/sqlx/hll_sketch_union.sqlx
+++ b/hll/sqlx/hll_sketch_union.sqlx
@@ -33,5 +33,5 @@ For more information:
  - https://datasketches.apache.org/docs/HLL/HllSketches.html
 '''
 ) AS (
-  $BQ_DATASET.hll_sketch_union_lgk_type(sketchA, sketchB, NULL, NULL)
+  ${ref("hll_sketch_union_lgk_type")}(sketchA, sketchB, NULL, NULL)
 );
diff --git a/substitute_and_run.sh b/substitute_and_run.sh
index 95f2abb..3648474 100755
--- a/substitute_and_run.sh
+++ b/substitute_and_run.sh
@@ -2,6 +2,10 @@
 
 FILE=$1
 
+if [ -u $BQ_PROJECT ]; then
+  echo "environment variable BQ_PROJECT must be set"
+  exit
+fi
 if [ -u $BQ_DATASET ]; then
   echo "environment variable BQ_DATASET must be set"
   exit
@@ -13,4 +17,4 @@ fi
 
 FUNC=${FILE##*/}
 FUNC=${FUNC%%.*}
-sed -e 
"s/\${self()}/${BQ_DATASET}.${FUNC}/;s/\$GCS_BUCKET/${GCS_BUCKET}/g;s/\$BQ_DATASET/${BQ_DATASET}/g"
 ${FILE} | grep -v -e"^config" | bq query --nouse_legacy_sql
+sed -e 
"s/\${self()}/\`${BQ_PROJECT}.${BQ_DATASET}.${FUNC}\`/;s/\$GCS_BUCKET/${GCS_BUCKET}/g;s/\$BQ_DATASET/${BQ_DATASET}/g;s/\${ref(\"\([^\"]*\)\")}/\`${BQ_PROJECT}.${BQ_DATASET}.\1\`/g"
 ${FILE} | grep -v -e"^config" | bq query --nouse_legacy_sql
diff --git a/theta/sqlx/theta_sketch_a_not_b.sqlx 
b/theta/sqlx/theta_sketch_a_not_b.sqlx
index 996e591..5c4648b 100644
--- a/theta/sqlx/theta_sketch_a_not_b.sqlx
+++ b/theta/sqlx/theta_sketch_a_not_b.sqlx
@@ -33,5 +33,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
  '''
 ) AS (
-  $BQ_DATASET.theta_sketch_a_not_b_seed(sketchA, sketchB, NULL)
+  ${ref("theta_sketch_a_not_b_seed")}(sketchA, sketchB, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_agg_int64.sqlx 
b/theta/sqlx/theta_sketch_agg_int64.sqlx
index 6dcda57..3cd6420 100644
--- a/theta/sqlx/theta_sketch_agg_int64.sqlx
+++ b/theta/sqlx/theta_sketch_agg_int64.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
  '''
 ) AS (
-  $BQ_DATASET.theta_sketch_agg_int64_lgk_seed_p(value, STRUCT<BYTEINT, INT64, 
FLOAT64>(NULL, NULL, NULL))
+  ${ref("theta_sketch_agg_int64_lgk_seed_p")}(value, STRUCT<BYTEINT, INT64, 
FLOAT64>(NULL, NULL, NULL))
 );
diff --git a/theta/sqlx/theta_sketch_agg_string.sqlx 
b/theta/sqlx/theta_sketch_agg_string.sqlx
index 1637936..9260d47 100644
--- a/theta/sqlx/theta_sketch_agg_string.sqlx
+++ b/theta/sqlx/theta_sketch_agg_string.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
  '''
 ) AS (
-  $BQ_DATASET.theta_sketch_agg_string_lgk_seed_p(str, STRUCT<BYTEINT, INT64, 
FLOAT64>(NULL, NULL, NULL))
+  ${ref("theta_sketch_agg_string_lgk_seed_p")}(str, STRUCT<BYTEINT, INT64, 
FLOAT64>(NULL, NULL, NULL))
 );
diff --git a/theta/sqlx/theta_sketch_agg_union.sqlx 
b/theta/sqlx/theta_sketch_agg_union.sqlx
index 8acc856..195c03d 100644
--- a/theta/sqlx/theta_sketch_agg_union.sqlx
+++ b/theta/sqlx/theta_sketch_agg_union.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_agg_union_lgk_seed(sketch, STRUCT<BYTEINT, 
INT64>(NULL, NULL))
+  ${ref("theta_sketch_agg_union_lgk_seed")}(sketch, STRUCT<BYTEINT, 
INT64>(NULL, NULL))
 );
diff --git a/theta/sqlx/theta_sketch_get_estimate.sqlx 
b/theta/sqlx/theta_sketch_get_estimate.sqlx
index 0d33f4c..18f5ec1 100644
--- a/theta/sqlx/theta_sketch_get_estimate.sqlx
+++ b/theta/sqlx/theta_sketch_get_estimate.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_get_estimate_seed(sketch, NULL)
+  ${ref("theta_sketch_get_estimate_seed")}(sketch, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_get_estimate_and_bounds.sqlx 
b/theta/sqlx/theta_sketch_get_estimate_and_bounds.sqlx
index 305e369..a4b22ab 100644
--- a/theta/sqlx/theta_sketch_get_estimate_and_bounds.sqlx
+++ b/theta/sqlx/theta_sketch_get_estimate_and_bounds.sqlx
@@ -38,5 +38,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_get_estimate_and_bounds_seed(sketch, num_std_devs, 
NULL)
+  ${ref("theta_sketch_get_estimate_and_bounds_seed")}(sketch, num_std_devs, 
NULL)
 );
diff --git a/theta/sqlx/theta_sketch_get_num_retained.sqlx 
b/theta/sqlx/theta_sketch_get_num_retained.sqlx
index 1626f39..aec61a2 100644
--- a/theta/sqlx/theta_sketch_get_num_retained.sqlx
+++ b/theta/sqlx/theta_sketch_get_num_retained.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_get_num_retained_seed(sketch, NULL)
+  ${ref("theta_sketch_get_num_retained_seed")}(sketch, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_get_theta.sqlx 
b/theta/sqlx/theta_sketch_get_theta.sqlx
index 2665c55..fed49a3 100644
--- a/theta/sqlx/theta_sketch_get_theta.sqlx
+++ b/theta/sqlx/theta_sketch_get_theta.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_get_theta_seed(sketch, NULL)
+  ${ref("theta_sketch_get_theta_seed")}(sketch, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_intersection.sqlx 
b/theta/sqlx/theta_sketch_intersection.sqlx
index 041ed49..d76869d 100644
--- a/theta/sqlx/theta_sketch_intersection.sqlx
+++ b/theta/sqlx/theta_sketch_intersection.sqlx
@@ -33,5 +33,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_intersection_seed(sketchA, sketchB, NULL)
+  ${ref("theta_sketch_intersection_seed")}(sketchA, sketchB, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_jaccard_similarity.sqlx 
b/theta/sqlx/theta_sketch_jaccard_similarity.sqlx
index 9cd81c7..8a07258 100644
--- a/theta/sqlx/theta_sketch_jaccard_similarity.sqlx
+++ b/theta/sqlx/theta_sketch_jaccard_similarity.sqlx
@@ -36,5 +36,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
  '''
 ) AS (
-  $BQ_DATASET.theta_sketch_jaccard_similarity_seed(sketchA, sketchB, NULL)
+  ${ref("theta_sketch_jaccard_similarity_seed")}(sketchA, sketchB, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_to_string.sqlx 
b/theta/sqlx/theta_sketch_to_string.sqlx
index 8fbb060..ad833aa 100644
--- a/theta/sqlx/theta_sketch_to_string.sqlx
+++ b/theta/sqlx/theta_sketch_to_string.sqlx
@@ -32,5 +32,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_to_string_seed(sketch, NULL)
+  ${ref("theta_sketch_to_string_seed")}(sketch, NULL)
 );
diff --git a/theta/sqlx/theta_sketch_union.sqlx 
b/theta/sqlx/theta_sketch_union.sqlx
index 66328df..aba1ef4 100644
--- a/theta/sqlx/theta_sketch_union.sqlx
+++ b/theta/sqlx/theta_sketch_union.sqlx
@@ -33,5 +33,5 @@ For more information:
  - https://datasketches.apache.org/docs/Theta/ThetaSketches.html
 '''
 ) AS (
-  $BQ_DATASET.theta_sketch_union_lgk_seed(sketchA, sketchB, NULL, NULL)
+  ${ref("theta_sketch_union_lgk_seed")}(sketchA, sketchB, NULL, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx 
b/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
index 5c28db8..dc140d9 100644
--- a/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_a_not_b.sqlx
@@ -35,5 +35,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_a_not_b_seed(sketchA, sketchB, NULL)
+  ${ref("tuple_sketch_int64_a_not_b_seed")}(sketchA, sketchB, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_agg_int64.sqlx 
b/tuple/sqlx/tuple_sketch_int64_agg_int64.sqlx
index e7f8b32..a047bed 100644
--- a/tuple/sqlx/tuple_sketch_int64_agg_int64.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_agg_int64.sqlx
@@ -36,5 +36,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_agg_int64_lgk_seed_p_mode(key, value, 
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(NULL, NULL, NULL, NULL))
+  ${ref("tuple_sketch_int64_agg_int64_lgk_seed_p_mode")}(key, value, 
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(NULL, NULL, NULL, NULL))
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_agg_string.sqlx 
b/tuple/sqlx/tuple_sketch_int64_agg_string.sqlx
index f3aab64..59766be 100644
--- a/tuple/sqlx/tuple_sketch_int64_agg_string.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_agg_string.sqlx
@@ -36,5 +36,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
  '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_agg_string_lgk_seed_p_mode(key, value, 
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(NULL, NULL, NULL, NULL))
+  ${ref("tuple_sketch_int64_agg_string_lgk_seed_p_mode")}(key, value, 
STRUCT<BYTEINT, INT64, FLOAT64, STRING>(NULL, NULL, NULL, NULL))
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_agg_union.sqlx 
b/tuple/sqlx/tuple_sketch_int64_agg_union.sqlx
index 464e22b..17f5387 100644
--- a/tuple/sqlx/tuple_sketch_int64_agg_union.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_agg_union.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_agg_union_lgk_seed_mode(sketch, STRUCT<lg_k 
BYTEINT, seed INT64, mode STRING>(NULL, NULL, NULL))
+  ${ref("tuple_sketch_int64_agg_union_lgk_seed_mode")}(sketch, STRUCT<lg_k 
BYTEINT, seed INT64, mode STRING>(NULL, NULL, NULL))
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_filter_low_high.sqlx 
b/tuple/sqlx/tuple_sketch_int64_filter_low_high.sqlx
index 63b1d8c..7751fff 100644
--- a/tuple/sqlx/tuple_sketch_int64_filter_low_high.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_filter_low_high.sqlx
@@ -38,5 +38,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_filter_low_high_seed(sketch, low, high, NULL)
+  ${ref("tuple_sketch_int64_filter_low_high_seed")}(sketch, low, high, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_from_theta_sketch.sqlx 
b/tuple/sqlx/tuple_sketch_int64_from_theta_sketch.sqlx
index 5e829c2..5f2950b 100644
--- a/tuple/sqlx/tuple_sketch_int64_from_theta_sketch.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_from_theta_sketch.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_from_theta_sketch_seed(sketch, value, NULL)
+  ${ref("tuple_sketch_int64_from_theta_sketch_seed")}(sketch, value, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_get_estimate.sqlx 
b/tuple/sqlx/tuple_sketch_int64_get_estimate.sqlx
index 0e5386a..bf11c35 100644
--- a/tuple/sqlx/tuple_sketch_int64_get_estimate.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_get_estimate.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_get_estimate_seed(sketch, NULL)
+  ${ref("tuple_sketch_int64_get_estimate_seed")}(sketch, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_get_estimate_and_bounds.sqlx 
b/tuple/sqlx/tuple_sketch_int64_get_estimate_and_bounds.sqlx
index d5db1fa..8bfbdde 100644
--- a/tuple/sqlx/tuple_sketch_int64_get_estimate_and_bounds.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_get_estimate_and_bounds.sqlx
@@ -40,5 +40,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_get_estimate_and_bounds_seed(sketch, 
num_std_devs, NULL)
+  ${ref("tuple_sketch_int64_get_estimate_and_bounds_seed")}(sketch, 
num_std_devs, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_get_num_retained.sqlx 
b/tuple/sqlx/tuple_sketch_int64_get_num_retained.sqlx
index 8a7bd1b..693af9c 100644
--- a/tuple/sqlx/tuple_sketch_int64_get_num_retained.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_get_num_retained.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_get_num_retained_seed(sketch, NULL)
+  ${ref("tuple_sketch_int64_get_num_retained_seed")}(sketch, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_get_sum_estimate_and_bounds.sqlx 
b/tuple/sqlx/tuple_sketch_int64_get_sum_estimate_and_bounds.sqlx
index 4775551..9905c1f 100644
--- a/tuple/sqlx/tuple_sketch_int64_get_sum_estimate_and_bounds.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_get_sum_estimate_and_bounds.sqlx
@@ -41,5 +41,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_get_sum_estimate_and_bounds_seed(sketch, 
num_std_devs, NULL)
+  ${ref("tuple_sketch_int64_get_sum_estimate_and_bounds_seed")}(sketch, 
num_std_devs, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_get_theta.sqlx 
b/tuple/sqlx/tuple_sketch_int64_get_theta.sqlx
index 4fa9528..1e73d7f 100644
--- a/tuple/sqlx/tuple_sketch_int64_get_theta.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_get_theta.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_get_theta_seed(sketch, NULL)
+  ${ref("tuple_sketch_int64_get_theta_seed")}(sketch, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_intersection.sqlx 
b/tuple/sqlx/tuple_sketch_int64_intersection.sqlx
index 8d8a82e..7d694c1 100644
--- a/tuple/sqlx/tuple_sketch_int64_intersection.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_intersection.sqlx
@@ -35,5 +35,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html 
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_intersection_seed_mode(sketchA, sketchB, 
NULL, NULL)
+  ${ref("tuple_sketch_int64_intersection_seed_mode")}(sketchA, sketchB, NULL, 
NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_jaccard_similarity.sqlx 
b/tuple/sqlx/tuple_sketch_int64_jaccard_similarity.sqlx
index 108cacd..6cd3dc9 100644
--- a/tuple/sqlx/tuple_sketch_int64_jaccard_similarity.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_jaccard_similarity.sqlx
@@ -37,5 +37,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
  '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_jaccard_similarity_seed(sketchA, sketchB, 
null)
+  ${ref("tuple_sketch_int64_jaccard_similarity_seed")}(sketchA, sketchB, null)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_to_string.sqlx 
b/tuple/sqlx/tuple_sketch_int64_to_string.sqlx
index c83d12a..74bea37 100644
--- a/tuple/sqlx/tuple_sketch_int64_to_string.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_to_string.sqlx
@@ -34,5 +34,5 @@ For more information:
  - https://datasketches.apache.org/docs/Tuple/TupleSketches.html
 '''
 ) AS (
-  $BQ_DATASET.tuple_sketch_int64_to_string_seed(sketch, NULL)
+  ${ref("tuple_sketch_int64_to_string_seed")}(sketch, NULL)
 );
diff --git a/tuple/sqlx/tuple_sketch_int64_union.sqlx 
b/tuple/sqlx/tuple_sketch_int64_union.sqlx
index 90d6fc4..79d6d03 100644
--- a/tuple/sqlx/tuple_sketch_int64_union.sqlx
+++ b/tuple/sqlx/tuple_sketch_int64_union.sqlx
@@ -36,5 +36,5 @@ For more information:
 '''
 ) 
 AS (
-  $BQ_DATASET.tuple_sketch_int64_union_lgk_seed_mode(sketchA, sketchB, NULL, 
NULL, NULL)
+  ${ref("tuple_sketch_int64_union_lgk_seed_mode")}(sketchA, sketchB, NULL, 
NULL, NULL)
 );


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

Reply via email to