edward_smith
06/22/2021, 3:18 PMvisch
06/22/2021, 3:20 PMedward_smith
06/22/2021, 3:36 PMedward_smith
06/24/2021, 9:39 PMextractors:
- name: cb_stats-0
inherit_from: tap-postgres-cb_stats
metadata:
public-stats_broadcasterstats:
replication-method: TIME_BASED
replication-key: time
replication-time-interval: 1 DAY
table-key-properties:
- user_id, timeThis had the desired effect of setting the
table_key_properties :
"table_name": "stats_broadcasterstats",
"stream": "stats_broadcasterstats",
"metadata": [
{
"breadcrumb": [],
"metadata": {
"table-key-properties": [
"user_id, time"
],However, it doesn't seem that pipelinewise-target-snowflake is respecting the keys and avoiding inserting duplicated like I had hoped.
ken_payne
06/25/2021, 5:25 PMken_payne
06/25/2021, 5:36 PM{
"stream_maps": {
"my_stream_without_pk": { // Apply these transforms to the stream called 'my_stream_without_pk'
"surrogate_pk": "md5(config['hash_seed'] + my_column_1 + my_column_2)", // for uniqueness checks
"__key_properties__": ["surrogate_pk"]
}
},
"stream_map_config": {
// hash outputs are not able to be replicated without the original seed:
"hash_seed": "01AWZh7A6DzGm6iJZZ2T"
}
}
My understanding is this i) creates a new filed as the MD5 of the seed + the two selected columns and ii) sets the key_properties to that new surrogate key?aaronsteers
06/25/2021, 5:38 PMken_payne
06/25/2021, 5:39 PMaaronsteers
06/25/2021, 5:39 PMken_payne
06/25/2021, 5:40 PMaaronsteers
06/25/2021, 5:40 PMaaronsteers
06/25/2021, 5:40 PMken_payne
06/25/2021, 5:41 PMken_payne
06/25/2021, 5:43 PMaaronsteers
06/25/2021, 5:45 PMaaronsteers
06/25/2021, 5:46 PMken_payne
06/25/2021, 5:47 PMaaronsteers
06/25/2021, 5:48 PMken_payne
06/25/2021, 5:53 PMaaronsteers
06/25/2021, 5:53 PMaaronsteers
06/25/2021, 5:54 PM'-'.join([column_a, column_b])aaronsteers
06/25/2021, 5:54 PMken_payne
06/25/2021, 5:55 PMaaronsteers
06/25/2021, 5:56 PMvisch
06/26/2021, 2:49 AMken_payne
06/26/2021, 7:53 AMvisch
06/26/2021, 12:22 PMedward_smith
06/28/2021, 2:09 PMkey_properties to be set in the SCHEMA message from tap-postgres. I've tried various forms of configuration of schema and metadata in meltano.yml , but I always get an empty key_properties emitted.
⢠Fabricating a unique key inline seems like a fun approach, I'll see if I can get that working.