-
Hey Scalefree Team, All three queries would create the same hashhdiff but for different ma groups. The delta check would not work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @cmettler and thanks for reaching out! Your input made me do some research, and apparently STRING_AGG() (SQL Server), LISTAGG() (Snowflake), and STRING_AGG() (BigQuery) all ignore NULL rows in the input. A row in the current multi-active hashdiff calculation is set to NULL, if all input columns are NULL, achieved by the "NULLIF" function around the CONCAT(). To fix this, that NULLIF needs to be replaced, e.g. by a REPLACE() function, that scans for the "all_null" string, which would indicate that all columns are NULL, and replace that by the NULL placeholder "^^". Based on the example code you provided, a SQL Server multi active hash calculation would need to look like this:
Please note that the multi-active attribute should not be included in the hashdiff calculation! Hope this helps! Will change the Code for Snowflake and BigQuery accordingly . |
Beta Was this translation helpful? Give feedback.
-
Hey Tim, DECLARE @delimiter NVARCHAR(MAX) = '||' ; |
Beta Was this translation helpful? Give feedback.
Hi @cmettler and thanks for reaching out!
Your input made me do some research, and apparently STRING_AGG() (SQL Server), LISTAGG() (Snowflake), and STRING_AGG() (BigQuery) all ignore NULL rows in the input.
A row in the current multi-active hashdiff calculation is set to NULL, if all input columns are NULL, achieved by the "NULLIF" function around the CONCAT().
To fix this, that NULLIF needs to be replaced, e.g. by a REPLACE() function, that scans for the "all_null" string, which would indicate that all columns are NULL, and replace that by the NULL placeholder "^^".
Based on the example code you provided, a SQL Server multi active hash calculation would need to look like this: