{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"ID Unification","type":"markdown"},"seo":{"title":"What is do_not_merge_key?","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"what-is-do_not_merge_key","__idx":0},"children":["What is do_not_merge_key?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key:"]}," option applies stitching rules that differ from the traditional Unification stitching rules:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the values of the key specified in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key:"]}," are different, records must ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," be stitched together (even if other keys link them)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Records without this key's value can be stitched together using other keys."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-to-use-do_not_merge_key","__idx":1},"children":["When to Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You have a unique key (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customer_id"]},") to ensure personal uniqueness."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For records lacking this key, you want to stitch based on secondary keys (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tel"]},") wherever possible."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By setting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key: member_id"]},", records with distinct ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},"s remain separate. For records without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},", stitching proceeds using the available keys."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Let's deepen our understanding with specific examples."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"dataset","__idx":2},"children":["Dataset"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This page use a single, simple table for this example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"site_aaa","__idx":3},"children":["site_aaa"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"member_id"},"children":["member_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"tel"},"children":["tel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"name"},"children":["name"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1111"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Taka"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2222"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tatsuo"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3333"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Naruse"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4444"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yuichiro"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5555"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Minero"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6666"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Kaz"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"id_unification_ex4dig","__idx":4},"children":["id_unification_ex4.dig"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["First, let's introduce the Workflow (WF) to be executed in this section."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"+call_unification:\n  http_call>: https://api-cdp.treasuredata.com/unifications/workflow_call  \n  headers:\n    - authorization: ${secret:td.apikey}\n  method: POST\n  retry: true\n  content_format: json\n  content:\n\n    run_canonical_ids: true\n    run_enrichments: true\n    run_master_tables: true\n\n    full_refresh: true\n    keep_debug_tables: true\n\n    unification:\n      !include : unification_ex4.yml\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"unification_ex4yml","__idx":5},"children":["unification_ex4.yml"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"name: test_id_unification_ex4\n\nkeys:\n  - name: member_id\n  - name: email\n\ntables:\n  - database: test_id_unification_ex4\n    table: site_aaa\n    key_columns:\n      - {column: member_id, key: member_id}\n      - {column: email, key: email}\n\ncanonical_ids:\n  - name: person_id\n    merge_by_keys: [member_id, email]\n    merge_iterations: 3\n    do_not_merge_key: member_id\n\nmaster_tables:\n  - name: master_table_ex4\n    canonical_id: person_id\n    attributes:\n      - name: member_id\n        source_columns:\n          - {table: site_aaa, priority: 1}\n      - name: email\n        source_columns:\n          - {table: site_aaa, priority: 1}\n      - name: tel\n        array_elements: 2\n        source_columns:\n          - {table: site_aaa, priority: 1}\n      - name: name\n        array_elements: 2\n        source_columns:\n          - {table: site_aaa, priority: 1}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cases-where-default-id-unification-falls-short","__idx":6},"children":["Cases Where Default ID Unification Falls Short"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, consider scenarios where the email used as a key includes shared addresses like mailing lists or family emails. In such cases, linking data based solely on email might mistakenly associate different individuals."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["However, removing email as a key would hinder proper stitching."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the other hand, there may also be keys like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]}," that ensure personal uniqueness."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here’s a potential stitching approach you might consider:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Prioritize stitching based on the values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]}," wherever possible."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]}," value exists, attempt stitching using email as a secondary key."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Let’s revisit the table below."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"member_id"},"children":["member_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"tel"},"children":["tel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"name"},"children":["name"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1111"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Taka"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2222"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tatsuo"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3333"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Naruse"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4444"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yuichiro"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5555"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Minero"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6666"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Kaz"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Given this data:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rows 1 and 2 share the same email but different ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},"s, so they shouldn’t be merged."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rows 3 and 4 share the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]}," and should be merged."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rows 5 and 6 lack ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},", so they should be merged based on email."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This ideal stitching behavior could be achieved using a specific unification option: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"without-using-do_not_merge_key","__idx":7},"children":["Without Using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Let’s consider a conventional approach without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]}," by configuring ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_ids"]}," as shown below:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"canonical_ids:\n  - name: person_id\n    merge_by_keys: [member_id, email]\n    merge_iterations: 3\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The output (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enriched_site_aaa"]}," table) wouldn’t meet expectations. Rows 1 and 2, despite having different ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["member_id"]},"s, are treated as the same individual because they share the same email. This happens even though their shared email is merely a mailing list address."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"member_id"},"children":["member_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"tel"},"children":["tel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"name"},"children":["name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"canonical_id"},"children":["canonical_id"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1111"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Taka"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4ydklKlyPnfa"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2222"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tatsuo"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4ydklKlyPnfa"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3333"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Naruse"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4444"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yuichiro"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5555"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Minero"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NEKDReELMAx"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6666"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Kaz"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NEKDReELMAx"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How can we ensure rows 1 and 2 are treated as different individuals?"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-do_not_merge_key","__idx":8},"children":["Using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Next, let’s configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_ids"]}," with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key"]}," option and execute the unification:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"canonical_ids:\n  - name: person_id\n    merge_by_keys: [member_id, email]\n    merge_iterations: 3\n    do_not_merge_key: member_id\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This results in the desired output where rows 1 and 2 are treated separately, while rows 5 and 6 are merged based on email."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"member_id"},"children":["member_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"tel"},"children":["tel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"name"},"children":["name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"canonical_id"},"children":["canonical_id"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1111"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Taka"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4ydklKlyPnfa"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2222"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tatsuo"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["XNKI3XAY1Hja"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3333"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Naruse"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4444"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yuichiro"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5555"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Minero"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NEKDReELMAx"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6666"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Kaz"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NEKDReELMAx"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["master_table"]}," output is as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"person_id"},"children":["person_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"member_id"},"children":["member_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"tel"},"children":["tel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"name"},"children":["name"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["58MMqWNFdAhu"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[1111]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[\"Taka\"]"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["WDbg4Lovngdu"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[2222]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[\"Tatsuo\"]"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["wkL-X_7PU2Ju"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[4444, 3333]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[\"Yuichiro\", \"Naruse\"]"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["UVs_qHcWwZnz"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NULL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[6666, 5555]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[\"Kaz\", \"Minero\"]"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"explanation-of-unification-algorithm","__idx":9},"children":["Explanation of Unification Algorithm"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Unification Algorithm for this case is explained."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"graph_unify_loop_0-123graph-also","__idx":10},"children":["graph_unify_loop_0 (1,2,3,graph also)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/graph_unify_loop_0.129fa62cb7c5b49d11a529d4000ba9f21e0fbcc81518bca666605cf3bfb06cbe.d0727cad.avif","alt":"canonical_id_1"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In fact, the initial graph is the final state this time."," ","In the conventional Algorithm, \"leader_id: 2\" should be replaced (merged) by \"leader_id: 1\" , but ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key:"]}," is set to member_id, so that it is not merged. So, no further changes are made."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"generation-and-assignment-of-canonical_id","__idx":11},"children":["Generation and assignment of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_id"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this case, four different ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_ids"]}," will be generated."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/7-2-1.1644eded0d718158cff2cdc00623d8d470eed253436d1dd1e680e83f52b38f3d.d0727cad.avif","alt":"canonical_id_1"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The difference is that \"follower: a@ex.com\" points to two leaders, \"member_id: 1\" and \"member_id: 2,\" regardless of the state of convergence."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In fact, there are 2 rows of records for a@ex.com in the lookup table."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"id"},"children":["id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"canonical_id"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_id"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4ydklKlyPnfa"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["XNKI3XAY1Hja"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4ydklKlyPnfa"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["a@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["XNKI3XAY1Hja"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["b@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["xqaWYjT4GR3a"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["c@ex.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NEKDReELMAxH"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This means that the algorithm has converged without \"all the followers point to only one leader,\" which is one of the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/id-unification/p9_knowledge"},"children":["methods to determine algorithm convergence"]},". However, the other method, \"checking the output of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+report_diff"]}," task in WF Logs\" is still valid."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cases-where-do_not_merge_key-should-be-used","__idx":12},"children":["Cases where do_not_merge_key should be used"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Finally, let's review the cases in which do_not_merge_key should be used. 1."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(Assumption) You have one key whose uniqueness is guaranteed (e.g. member_id, customer_id, etc.)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["for records that do not have the value of key 1., we want to proceed with stitching as much as possible, using a key whose uniqueness is not partially guaranteed (e.g., email, tel, etc.)."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this case, if you set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["do_not_merge_key: member_id"]},", the records will be judged as different persons even if other keys are stitched with the same value, as long as member_id is different. However, for records that do not have member_id, other keys are stitched together to the maximum extent possible."]}]},"headings":[{"value":"What is do_not_merge_key?","id":"what-is-do_not_merge_key","depth":1},{"value":"When to Use do_not_merge_key","id":"when-to-use-do_not_merge_key","depth":2},{"value":"Dataset","id":"dataset","depth":2},{"value":"site_aaa","id":"site_aaa","depth":3},{"value":"id_unification_ex4.dig","id":"id_unification_ex4dig","depth":3},{"value":"unification_ex4.yml","id":"unification_ex4yml","depth":3},{"value":"Cases Where Default ID Unification Falls Short","id":"cases-where-default-id-unification-falls-short","depth":2},{"value":"Without Using do_not_merge_key","id":"without-using-do_not_merge_key","depth":2},{"value":"Using do_not_merge_key","id":"using-do_not_merge_key","depth":2},{"value":"Explanation of Unification Algorithm","id":"explanation-of-unification-algorithm","depth":2},{"value":"graph_unify_loop_0 (1,2,3,graph also)","id":"graph_unify_loop_0-123graph-also","depth":3},{"value":"Generation and assignment of canonical_id","id":"generation-and-assignment-of-canonical_id","depth":3},{"value":"Cases where do_not_merge_key should be used","id":"cases-where-do_not_merge_key-should-be-used","depth":2}],"frontmatter":{"seo":{"title":"What is do_not_merge_key?"}},"lastModified":"2026-02-17T01:46:37.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/id-unification/p6_do_not_merge","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}