bigquery-utils icon indicating copy to clipboard operation
bigquery-utils copied to clipboard

Unable to find module in theta_sketch.mjs for theta_sketch_int64

Open sohamsilpg opened this issue 1 year ago • 2 comments

Hello,

I have generated the theta_sketch.mjs file using make command and used the following script to create theta_sketch_int64 UDF. https://github.com/GoogleCloudPlatform/bigquery-utils/blob/master/udfs/community/theta_sketch_int64.sqlx

However, I am getting the following error while invoking the theta_sketch_int64 UDF in BigQuery.

TypeError: Module._clamp_lg_k is not a function at theta_sketch_test.theta_sketch_int64(INT64, INT64) line 56, columns 16-17

Looking for assistance to resolve this issue.

Thanks

sohamsilpg avatar Sep 23 '24 09:09 sohamsilpg

Can you please detail the exact steps you took to deploy the UDF?

The build process in this repo does the following within the udfs/datasketches/ directory:

    git clone https://github.com/apache/datasketches-cpp.git
    for dir in kll-sketch theta-sketch tuple-sketch; do
      cd $dir && make clean && make all
      cd ..
    done

and then you have to copy the js_builds/* directory into your own specified ${_JS_BUCKET}

danieldeleo avatar Oct 15 '24 14:10 danieldeleo

Hi @danieldeleo , Thanks for the suggestion. I ran the build process by following the instructions in the repo and the UDFs got created in my project. However, I am facing the following issues while using the UDFs.

  • If I only use the bucket name, then I am getting a message saying Access Denied. Please check below screenshots. theta_sketch_1 theta_sketch_1_1

  • If I use gs:// in front of the bucket name then I get an error saying Module not found. Please check below screenshots. theta_sketch_2 theta_sketch_2_1

Can you please help me to understand which option is correct and how to resolve the issue? FYI, the bucket is created in location : us (multiple regions in United States), same as the dataset.

sohamsilpg avatar Dec 16 '24 09:12 sohamsilpg