Final lab: design and reconcile a document pipeline
Turn the six simulated deliveries into a current document inventory, then use the same reconciliation questions to design a real connector rollout.
Understand the idea
Your scenario is an approved SharePoint policy site plus a Google Workspace shared drive. The SQL path uses only the fixtures from lessons 1–6. It is a destination simulation; completing it does not mean a real connector has run.
| Concept | What it means |
|---|---|
| Landing | Preserve source evidence and delivery metadata. |
| Current state | One latest row per source/document key. |
| Active view | Exclude deletion markers. |
| Acceptance evidence | Expected IDs, versions, counts, permissions and recovery behavior. |
A concrete example
Your scenario is an approved SharePoint policy site plus a Google Workspace shared drive. The SQL path uses only the fixtures from lessons 1–6. It is a destination simulation; completing it does not mean a real connector has run.
Remember: The SQL lab proves the sample reconciliation logic only. Live source sync, permission enforcement and recovery require separate administrator-assisted exercises.
Explain it step by step · full theory
Understand the idea
Your scenario is an approved SharePoint policy site plus a Google Workspace shared drive. The SQL path uses only the fixtures from lessons 1–6. It is a destination simulation; completing it does not mean a real connector has run.
First run the conflict query below. It must return no rows before building current state. Exact duplicate deliveries are harmless here because all their business fields agree. Our snapshot rebuild is a small batch exercise, not an incremental MERGE or an exactly-once guarantee.
Apply it carefully
The result should retain three identities: SharePoint policy-1 version 2, SharePoint guide-1 version 2 marked deleted, and Drive policy-1 version 1. The active view contains two policies. The FINANCE and STAFF labels remain metadata; the view does not implement production ACL enforcement.
For the optional real rollout, obtain approved source identities, scoped runtime/network access and destination grants; choose the correct connector variants; sync a small baseline; update a file; revoke test access; delete a file; and simulate a documented recoverable interruption. Compare expected source IDs and access with actual destination output after each action. Record gaps and resolve them before expanding scope.
Finish by naming the operator, freshness target, alert destination, replay procedure and reconciliation schedule. Stop the optional practice flow using its documented controls after checking queued work, and coordinate cleanup with the administrator. Keep the SQL schema until you finish comparing outputs; do not remove shared deployments.
Words used in this lesson
- Landing
- Preserve source evidence and delivery metadata.
- Current state
- One latest row per source/document key.
- Active view
- Exclude deletion markers.
- Acceptance evidence
- Expected IDs, versions, counts, permissions and recovery behavior.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Final lab: design and reconcile a document pipeline
Follow the flow
Turn the six simulated deliveries into a current document inventory, then use the same reconciliation questions to design a real connector rollout.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Follow the flow
Turn the six simulated deliveries into a current document inventory, then use the same reconciliation questions to design a real connector rollout.
- Find the boundary
Finish by naming the operator, freshness target, alert destination, replay procedure and reconciliation schedule. Stop the optional practice flow using its documented controls after checking queued work, and coordinate cleanup with the administrator. Keep the SQL schema until you finish comparing outputs; do not remove shared deployments.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
SQL practice is manual. The website does not connect to external services. Connector deployment is a separate administrator-assisted exercise.
Hands-on SQL: Final lab: design and reconcile a document pipeline
-- Must return zero conflicting business versions:
SELECT SOURCE_SYSTEM,DOCUMENT_ID,SOURCE_VERSION
FROM (SELECT DISTINCT SOURCE_SYSTEM,DOCUMENT_ID,SOURCE_VERSION,TITLE,OP,PERMISSION_GROUP
FROM DOCUMENT_EVENTS)
GROUP BY 1,2,3 HAVING COUNT(*)>1;
-- Run only after reviewing the conflict query and the invalid-row query:
CREATE TABLE DOCUMENT_CURRENT AS
SELECT SOURCE_SYSTEM,DOCUMENT_ID,SOURCE_VERSION,TITLE,OP,PERMISSION_GROUP
FROM DOCUMENT_EVENTS
QUALIFY ROW_NUMBER() OVER(PARTITION BY SOURCE_SYSTEM,DOCUMENT_ID
ORDER BY SOURCE_VERSION DESC,INGESTED_AT DESC)=1;
CREATE VIEW ACTIVE_DOCUMENTS AS SELECT * FROM DOCUMENT_CURRENT WHERE OP='UPSERT';
SELECT * FROM DOCUMENT_CURRENT ORDER BY SOURCE_SYSTEM,DOCUMENT_ID;
SELECT SOURCE_SYSTEM,DOCUMENT_ID,SOURCE_VERSION FROM ACTIVE_DOCUMENTS
ORDER BY SOURCE_SYSTEM,DOCUMENT_ID;
SELECT COUNT(*) AS CURRENT_IDENTITIES FROM DOCUMENT_CURRENT;What to expect and why
Conflict query: 0 rows. Current identities: 3, including one deletion marker. Active rows: GOOGLE_DRIVE/policy-1/version 1 and SHAREPOINT/policy-1/version 2. Run CREATE statements once or use fresh lab names.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
Explain your decision: Does this SQL lab prove live connector synchronization and ACL enforcement?
Compare your reasoning
The SQL lab proves the sample reconciliation logic only. Live source sync, permission enforcement and recovery require separate administrator-assisted exercises.
Official sources and curriculum
Module 09 · See module scope