MSSQL: Customer-Managed UDAF Installation
Download the Binaries
Follow this
link
to download the .dll file and SHA512 hash.
MSSQL: Register the HLL Functions
- 
From your MSSQL Server configuration, turn on the clr_enabled option. sp_configure clr_enabled, 1 RECONFIGURE;
- 
For MSSQL Server 2016, use the following SQL script. 
- 
For MSSQL Server 2017 and later, use the following SQL script. 
MSSQL: Additional Steps
- 
Open the SQL Script (2016 or 2017) with a text editor, and replace the exact .dllfile name and location in the SQL file.
- 
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
- 
Copy the .dlland.sqlfile to your MSSQL Server (For example, in/tmp)
- 
Execute the edited SQL File. 
- 
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
- 
Execute the following SQL query against your MSSQL database: select ATSCALEUDAF.hll_estimate(1)
- 
If the SQL query returns 1the HLL functions were successfully installed.
- 
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.