Skip to content

Commit

Permalink
bug (PADW-80): Add missing TEXT TYPE conversion within HASH ARRAY (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
analyzer1 authored Dec 10, 2024
1 parent 7c4d90f commit 87fcac6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extension/src/controller/dv_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn create_dv_link_dml_for_lks(dv_schema: &DVSchema) -> String {
.map(|part_link| format!("{}", part_link.source_columns[0].column_name))
.collect();

let bk_source_parts_joined = bk_parts.join(",");
let bk_source_parts_joined = bk_parts.join("::TEXT,") + "::TEXT";
let business_key_name = &business_key.name;

hub_hash_sqls.push(format!("auto_dw.hash(ARRAY_TO_STRING(ARRAY[{bk_source_parts_joined}], ',')) AS hub_{business_key_name}_hk"));
Expand All @@ -98,7 +98,7 @@ fn create_dv_link_dml_for_lks(dv_schema: &DVSchema) -> String {
}

let link_key_name = &link_key.name;
let link_hk_parts = &link_bk_source_parts_name.join(", ");
let link_hk_parts = &(link_bk_source_parts_name.join("::TEXT, ") + "::TEXT");
let link_hk_sql =
format!("auto_dw.hash(ARRAY_TO_STRING(ARRAY[{link_hk_parts}], ',')) AS link_{link_key_name}_hk,");
let timestamp_sql = format!("(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')::TIMESTAMP(6) AS load_ts,");
Expand Down Expand Up @@ -211,7 +211,7 @@ fn create_dv_sat_dml_for_lks_descriptors (dv_schema: &DVSchema) -> String {
.map(|part_link| format!("{}", part_link.source_columns[0].column_name))
.collect();

let bk_source_parts_joined = bk_parts.join(",");
let bk_source_parts_joined = bk_parts.join("::TEXT,") + "::TEXT";
let business_key_name = &business_key.name;

hub_hash_sqls.push(format!("auto_dw.hash(ARRAY_TO_STRING(ARRAY[{bk_source_parts_joined}], ',')) AS hub_{business_key_name}_hk"));
Expand Down

0 comments on commit 87fcac6

Please sign in to comment.