MSSQL: Customer-Managed UDAF Installation

Download the Binaries

Follow this link to download the .dll file and SHA512 hash.

MSSQL: Register the HLL Functions

  1. From your MSSQL Server configuration, turn on the clr_enabled option.

    sp_configure clr_enabled, 1 RECONFIGURE;
  2. For MSSQL Server 2016, use the following SQL script.

  3. For MSSQL Server 2017 and later, use the following SQL script.

MSSQL: Additional Steps

  1. Open the SQL Script (2016 or 2017) with a text editor, and replace the exact .dll file name and location in the SQL file.

  2. For MSSQL Server 2017 or later, replace the {DLLSHA512HASH} string in the SQL script with the hash value you downloaded as described above.

    Here is an example showing how the corresponding line of the script should look like:

    EXEC sys.sp_add_trusted_assembly 0xc96c3187794385b89a35c5948af538d82688a0cdbae13c2a4f39beb03d46714eb750f9cc6f2f5040594c06b63025c3250a6c3f04364d5487cb06f33e41a53461
  3. Copy the .dll and .sql file to your MSSQL Server (For example, in /tmp)

  4. Execute the edited SQL File.

  5. Execute the following SQL Queries:

    CREATE FUNCTION ATSCALEUDAF.atscale_honeybee_version () RETURNS nvarchar(100) EXTERNAL NAME AtScaleHLLFunctions.[Com.Atscale.Honeybee.Mssql.HoneyBeeVersionUDF].Version

    CREATE FUNCTION ATSCALEUDAF.quantileFromSketch (@s nvarchar(max), @q float) RETURNS float EXTERNAL NAME AtScaleHLLFunctions.[Com.Atscale.Honeybee.Mssql.QuantileEstimateFromSketchUDF].Evaluate
  6. Execute the following SQL query against your MSSQL database:

    select ATSCALEUDAF.hll_estimate(1)
  7. If the SQL query returns 1 the HLL functions were successfully installed.

  8. Choose Settings from the top navigation menu, select Data Warehouses, and edit your MSSQL data warehouse. Select Customer managed for User Defined Aggregate Functions mode.