<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shubham Baldava</title>
    <description>The latest articles on DEV Community by Shubham Baldava (@shubham_olake).</description>
    <link>https://dev.to/shubham_olake</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4212879%2Fd265c69e-976b-4b2b-a4ba-0d6c44484c21.png</url>
      <title>DEV Community: Shubham Baldava</title>
      <link>https://dev.to/shubham_olake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shubham_olake"/>
    <language>en</language>
    <item>
      <title>Oracle to BigQuery With Only a Read-Only User: A Hands-On BigLake Tutorial</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Wed, 02 Dec 2026 18:59:43 +0000</pubDate>
      <link>https://dev.to/shubham_olake/oracle-to-bigquery-with-only-a-read-only-user-a-hands-on-biglake-tutorial-38cf</link>
      <guid>https://dev.to/shubham_olake/oracle-to-bigquery-with-only-a-read-only-user-a-hands-on-biglake-tutorial-38cf</guid>
      <description>&lt;p&gt;Ask how to move Oracle to BigQuery and the first two answers both want the redo log. Google's Datastream reads it and needs supplemental logging switched on in Oracle. Oracle GoldenGate reads it under a license.&lt;/p&gt;

&lt;p&gt;Plenty of teams get neither. The database administrator (DBA) hands over a read-only user, and what is left is a nightly export plus &lt;code&gt;bq load&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The usual ways to get Oracle rows into BigQuery:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/datastream/docs/overview" rel="noopener noreferrer"&gt;Datastream for Oracle&lt;/a&gt;:&lt;/strong&gt; Google's managed change data capture (CDC) service, near real time by Google's description. You set up a connection profile and a stream and run nothing yourself. The rows land in native BigQuery datasets, and BigQuery is the only reader of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.oracle.com/en/middleware/goldengate/core/" rel="noopener noreferrer"&gt;Oracle GoldenGate&lt;/a&gt; to BigQuery:&lt;/strong&gt; changes in seconds, updates and deletes included, into native BigQuery tables. You run GoldenGate Extract and Replicat, and GoldenGate is a licensed Oracle option.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export, then &lt;code&gt;bq load&lt;/code&gt;:&lt;/strong&gt; Data Pump or a &lt;code&gt;SELECT&lt;/code&gt; to CSV, a scheduler and a staging bucket. Freshness is hours to daily, and every run is a full reload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT):&lt;/strong&gt; Fivetran, Estuary or Airbyte Cloud. Nothing to host and freshness in minutes by plan, priced per row, per GB or per connector, for a second copy inside BigQuery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial builds a fifth one, and that read-only user is all it asks of Oracle. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, reads the tables over a plain Java Database Connectivity (JDBC) connection. It copies each table in full once, then on every later run fetches the rows whose &lt;code&gt;UPDATED_AT&lt;/code&gt; moved.&lt;/p&gt;

&lt;p&gt;The rows are written as Apache Iceberg tables into BigLake, Google Cloud's Iceberg representational state transfer (REST) catalog. The Parquet files stay in a Cloud Storage bucket you own. BigQuery queries them by a four-part name, with no dataset to create and no external table to declare.&lt;/p&gt;

&lt;p&gt;The price of skipping the log: OLake Go has no log-based CDC for Oracle. The cursor column carries every change, so a row that is hard-deleted in Oracle stays in BigQuery.&lt;/p&gt;

&lt;p&gt;I ran each step on 2026-10-30 with Oracle Database 23ai Free in Docker, OLake Go v1.1.0 in OLake UI, and a bucket in &lt;code&gt;us-central1&lt;/code&gt;. The timings and row counts below are from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Oracle to BigQuery pipeline in three parts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;code&gt;CUSTOMERS&lt;/code&gt; and &lt;code&gt;ORDERS&lt;/code&gt; in a schema named &lt;code&gt;SHOP&lt;/code&gt;, read by a user that can only &lt;code&gt;SELECT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake Go on Docker Compose. The first sync reads each table in parallel chunks and saves the highest cursor value; later syncs upsert the rows above it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; a BigLake catalog named after the bucket, which BigQuery treats as a data source.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Oracle Database 11g or later reachable over JDBC, a Google Cloud project with BigQuery, Docker, and about 30 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Oracle needs a user, a key and a cursor
&lt;/h2&gt;

&lt;p&gt;Use tables you already have, or create the two from my run. They live in the &lt;code&gt;SHOP&lt;/code&gt; schema of the pluggable database &lt;code&gt;FREEPDB1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;GENERATED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;GENERATED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Load any rows you like. My run began with 8 customers and 40 orders, and step 7 expects customers named Liam Carter and Zara Ali among those 8.&lt;/p&gt;

&lt;p&gt;OLake Go asks three things of Oracle before the first sync:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A read-only user&lt;/strong&gt; with &lt;code&gt;CREATE SESSION&lt;/code&gt; and &lt;code&gt;SELECT&lt;/code&gt; on each table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A cursor column&lt;/strong&gt; that grows with every change, such as &lt;code&gt;updated_at&lt;/code&gt;. Incremental syncs select &lt;code&gt;WHERE cursor &amp;gt; last value&lt;/code&gt;, so a row updated without touching it is skipped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A primary key&lt;/strong&gt; on every table. Changed rows are upserted on it, and without one they are appended.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create the user as a DBA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- 1. A user for OLake Go&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="no"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SESSION&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- 2. Read access to the tables you sync&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ANY&lt;/span&gt; &lt;span class="no"&gt;DICTIONARY&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- lets discovery read the catalog views&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then verify it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;all_users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;all_tables&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SHOP'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first query answers with &lt;code&gt;OLAKE&lt;/code&gt; in capitals, since the user was created without double quotes. Hold on to that for step 3.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ A deleted row has no cursor value to read, so it stays in the Iceberg table. If deletes matter, soft-delete with a &lt;code&gt;deleted_at&lt;/code&gt; column that also bumps &lt;code&gt;updated_at&lt;/code&gt;, or schedule an occasional full refresh.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: A bucket and a service account in Google Cloud
&lt;/h2&gt;

&lt;p&gt;All of this is done in the Google Cloud console, in the project that will hold the tables.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable the API.&lt;/strong&gt; Under &lt;strong&gt;APIs and services&lt;/strong&gt;, &lt;strong&gt;Enable APIs and services&lt;/strong&gt;, turn on the &lt;strong&gt;BigLake API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a bucket.&lt;/strong&gt; In &lt;strong&gt;Cloud Storage&lt;/strong&gt;, make one in the region where BigQuery will run the queries, which was &lt;code&gt;us-central1&lt;/code&gt; for me. Its name becomes the catalog name you type in SQL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a service account.&lt;/strong&gt; In &lt;strong&gt;IAM and Admin&lt;/strong&gt; (Identity and Access Management), &lt;strong&gt;Service Accounts&lt;/strong&gt;, add one such as &lt;code&gt;olake-biglake&lt;/code&gt;. Give it &lt;strong&gt;BigLake Editor&lt;/strong&gt; on the project and &lt;strong&gt;Storage Object User&lt;/strong&gt; on the bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download a key.&lt;/strong&gt; On its &lt;strong&gt;Keys&lt;/strong&gt; tab choose &lt;strong&gt;Add key&lt;/strong&gt;, &lt;strong&gt;Create new key&lt;/strong&gt;, &lt;strong&gt;JSON&lt;/strong&gt;. The console hands the file over once.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs6qnzr7a3sfhfwt01i4p.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs6qnzr7a3sfhfwt01i4p.webp" alt="Google Cloud console Create private key dialog for the OLake service account with the JSON key type selected" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No catalog has to be made by hand. BigLake creates a single-bucket catalog named after the bucket the first time OLake Go calls the endpoint with &lt;code&gt;gs://&amp;lt;bucket&amp;gt;&lt;/code&gt; as the catalog path.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Keep that catalog in its default end-user credential mode. OLake Go 1.1.0 does not send the &lt;code&gt;X-Iceberg-Access-Delegation&lt;/code&gt; header, so a catalog moved to vended credentials fails the destination test in step 4.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add the Oracle source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in. Go to &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt;, pick &lt;strong&gt;Oracle&lt;/strong&gt;, name the source and keep the OLake Go version on the latest release.&lt;/p&gt;

&lt;p&gt;The values from my run: host &lt;code&gt;host.docker.internal&lt;/code&gt; since Oracle sat in another container, port &lt;code&gt;1521&lt;/code&gt;, connection type &lt;strong&gt;Service Name&lt;/strong&gt; with &lt;code&gt;FREEPDB1&lt;/code&gt;, and SSL mode &lt;code&gt;disable&lt;/code&gt;. A system identifier (SID) is the other connection type. The &lt;strong&gt;Enable CDC&lt;/strong&gt; switch is greyed out and tagged as not supported.&lt;/p&gt;

&lt;p&gt;Enter the username as &lt;code&gt;OLAKE&lt;/code&gt;, in capitals. OLake Go puts the name in quotes when it connects, so Oracle compares it case-sensitively, and &lt;code&gt;olake&lt;/code&gt; in lower case is a user that does not exist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6itqlag2amv5e5sk0m4.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6itqlag2amv5e5sk0m4.webp" alt="OLake UI source form for Oracle on OLake Go v1.1.0 with Enable CDC marked not supported, host host.docker.internal, port 1521, connection type Service Name, service name FREEPDB1 and username OLAKE" width="790" height="960"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. OLake Go tests the connection and saves the source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add BigLake as the destination
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;, choose &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector and &lt;strong&gt;BigLake&lt;/strong&gt; as the catalog type. Then fill in:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://biglake.googleapis.com/iceberg/v1/restcatalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BigLake Catalog Path&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;gs://&amp;lt;bucket&amp;gt;&lt;/code&gt;, bucket root only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication Type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GCP&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Service Account JSON&lt;/td&gt;
&lt;td&gt;the complete key file from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catalog Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;olake_iceberg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Auth Scopes&lt;/td&gt;
&lt;td&gt;the default, &lt;code&gt;https://www.googleapis.com/auth/cloud-platform&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Project ID&lt;/td&gt;
&lt;td&gt;your project's ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enable Arrow Writes&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fewugbfktwi1tyyd2xwo7.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fewugbfktwi1tyyd2xwo7.webp" alt="OLake UI destination form for Apache Iceberg with catalog type Big Lake, the BigLake REST catalog URI, a gs bucket as the BigLake catalog path, authentication type GCP and the project ID" width="790" height="1050"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go calls the BigLake endpoint, creates the catalog if this is the first contact, and writes and drops a test table in the bucket. A &lt;code&gt;403&lt;/code&gt; from &lt;code&gt;biglake.googleapis.com&lt;/code&gt; means the BigLake Editor grant is missing, and a &lt;code&gt;403&lt;/code&gt; from &lt;code&gt;storage.googleapis.com&lt;/code&gt; means Storage Object User is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. Mine was called &lt;code&gt;oracle_to_bigquery&lt;/code&gt;. Give it a schedule, then select the source and destination you just made.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Google BigQuery, Apache Spark and DuckDB. OLake Go then offers only the delete formats all three can read, which are equality and positional deletes. Deletion vectors drop off the list because BigQuery reads them only in preview.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt; to open the &lt;strong&gt;Streams&lt;/strong&gt; page, and tick &lt;code&gt;CUSTOMERS&lt;/code&gt; and &lt;code&gt;ORDERS&lt;/code&gt; under &lt;code&gt;SHOP&lt;/code&gt;. For each one, set the sync mode to &lt;strong&gt;Full Refresh + Incremental&lt;/strong&gt; with &lt;code&gt;UPDATED_AT&lt;/code&gt; as the cursor field and the ingestion mode to &lt;strong&gt;Upsert&lt;/strong&gt;. Leave &lt;strong&gt;Upsert Type&lt;/strong&gt; as OLake Go resolved it, which was &lt;strong&gt;Positional Deletes&lt;/strong&gt; in my run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv6blo98g6oapm95aznm2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv6blo98g6oapm95aznm2.webp" alt="OLake UI Streams Selection page with the SHOP schema, CUSTOMERS and ORDERS ticked, sync mode Full Refresh + Incremental, cursor field UPDATED_AT, ingestion mode Upsert and upsert type Positional Deletes on Iceberg format version V2" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;. The first run copied 8 customers and 40 orders (48 records, 2.24 KB) and finished in &lt;strong&gt;32 seconds&lt;/strong&gt;, container start included.&lt;/p&gt;

&lt;p&gt;The BigLake namespace takes its name from the job and the source schema, lower-cased, so mine became &lt;code&gt;oracle_to_bigquery_shop&lt;/code&gt;. For a different name, edit the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in BigQuery
&lt;/h2&gt;

&lt;p&gt;Nothing gets registered. The bucket is the catalog, the namespace is the dataset, and the tables are the tables. In the BigQuery SQL editor, set the query location to the bucket's region and write the four-part name in backticks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.oracle_to_bigquery_shop.customers`&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(amount), 2) AS total
FROM `&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.oracle_to_bigquery_shop.orders`
GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The account that runs the queries needs the BigQuery Job User role plus read access to the catalog.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Mind the location. On the default &lt;code&gt;US&lt;/code&gt; multi-region, a catalog whose bucket is regional answers &lt;code&gt;Not found: Dataset&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OLake Go adds four columns to every table, &lt;code&gt;_op_type&lt;/code&gt; among them. Straight after the first sync it is &lt;code&gt;r&lt;/code&gt; on every row, meaning the row came from the snapshot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in Oracle and sync again
&lt;/h2&gt;

&lt;p&gt;Next I made 12 changes in the &lt;code&gt;SHOP&lt;/code&gt; schema: 7 inserts and 5 updates. Every &lt;code&gt;UPDATE&lt;/code&gt; sets &lt;code&gt;updated_at&lt;/code&gt; as well, because that column is all the cursor can see.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; a second time. This sync fetched &lt;strong&gt;12 rows (598 bytes)&lt;/strong&gt; above the saved cursor and took &lt;strong&gt;45 seconds&lt;/strong&gt; end to end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwbyg4z9lovr1uzi11yp4.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwbyg4z9lovr1uzi11yp4.webp" alt="OLake UI Job Logs and History for oracle_to_bigquery listing two completed syncs with runtimes of 32s and 45s" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt; the commit was one new data file with 4 rows: the 2 inserts plus the new versions of the 2 updated rows. One small positional delete file retires the 2 old versions, and &lt;code&gt;orders&lt;/code&gt; got the same shape with 8 rows and 3 deletes. The commit report in the sync log reads &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedPositionalDeleteFiles=1&lt;/code&gt;, &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7niwawx74oj6st2mjt2q.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7niwawx74oj6st2mjt2q.webp" alt="OLake UI sync log filtered to the Iceberg commit report for the incremental sync, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4 and addedPositionalDeletes 2" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the customers query again, with no refresh and no &lt;code&gt;ALTER TABLE&lt;/code&gt; in between. BigQuery returns 10 rows, one per key: Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali has moved to Abu Dhabi, and Maya Patel and Lucas Silva have arrived.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2oytjnnnmsaumn1xyeik.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2oytjnnnmsaumn1xyeik.webp" alt="BigQuery SQL editor in the Google Cloud console running the customers query on the oracle_to_bigquery_shop dataset and returning 10 rows with id, name, city and tier" width="799" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;_op_type&lt;/code&gt; to the select list and one thing looks wrong at first. The two brand-new customers are marked &lt;code&gt;u&lt;/code&gt;, the same as the two updated ones, because incremental mode cannot tell an insert from an update. Rows the second sync never touched keep &lt;code&gt;r&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema changes.&lt;/strong&gt; Add a column in Oracle and OLake Go adds it to the Iceberg table on the next sync. Narrowing or incompatible type changes fail the sync rather than corrupt the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB and Spark
&lt;/h2&gt;

&lt;p&gt;A second engine can open the same files with nothing exported or copied. DuckDB attaches BigLake with a Google access token. For the files it also needs a hash-based message authentication code (HMAC) key for the service account, made under Cloud Storage, &lt;strong&gt;Settings&lt;/strong&gt;, &lt;strong&gt;Interoperability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7jui8hwm5w3flvigdie6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7jui8hwm5w3flvigdie6.webp" alt="Google Cloud console Cloud Storage Interoperability settings with the Select a service account dialog, the OLake service account selected and the Create key button" width="800" height="348"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- gcloud auth print-access-token, or a token minted for the service account&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access token&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;EXTRA_HTTP_HEADERS&lt;/span&gt; &lt;span class="no"&gt;MAP&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'x-goog-user-project'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;project-id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- the HMAC key pair for the bucket&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_files&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;gcs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac access id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'gs://&amp;lt;bucket&amp;gt;'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://biglake.googleapis.com/iceberg/v1/restcatalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oracle_to_bigquery_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers as BigQuery. Spark 4.0.1 with Iceberg 1.10.0 did too, from a laptop against the same catalog and bucket. The &lt;code&gt;orders&lt;/code&gt; roll-up matched Oracle to the cent in all three engines: 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;p&gt;The access token lives an hour. When a DuckDB query fails with &lt;code&gt;401&lt;/code&gt;, run &lt;code&gt;CREATE OR REPLACE SECRET&lt;/code&gt; with a fresh one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data types to check before you trust a sum
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Oracle&lt;/th&gt;
&lt;th&gt;BigQuery shows&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NUMBER(n,0)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;INT64&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;NUMBER(10)&lt;/code&gt; identity keys arrived as &lt;code&gt;INT64&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NUMBER(n,m)&lt;/code&gt; with a scale, &lt;code&gt;FLOAT&lt;/code&gt;, &lt;code&gt;BINARY_DOUBLE&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FLOAT64&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stored as doubles; round at query time for exact decimal arithmetic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;DATE&lt;/code&gt; and every &lt;code&gt;TIMESTAMP&lt;/code&gt; variant&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a UTC instant; an Oracle &lt;code&gt;DATE&lt;/code&gt; carries a time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;RAW&lt;/code&gt;, &lt;code&gt;BLOB&lt;/code&gt;, &lt;code&gt;BFILE&lt;/code&gt;, &lt;code&gt;INTERVAL&lt;/code&gt; types&lt;/td&gt;
&lt;td&gt;&lt;code&gt;STRING&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;binary values arrive as text; keep large binaries out of the sync&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The BigQuery column follows the &lt;a href="https://docs.cloud.google.com/bigquery/docs/iceberg-external-tables" rel="noopener noreferrer"&gt;BigQuery Iceberg tables page&lt;/a&gt; and the table schemas from my run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Index the cursor.&lt;/strong&gt; Each incremental sync runs one range query per table on &lt;code&gt;UPDATED_AT&lt;/code&gt;. On a large table, an index keeps that query from scanning everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close the gap in the write paths.&lt;/strong&gt; An &lt;code&gt;UPDATE&lt;/code&gt; that skips &lt;code&gt;updated_at&lt;/code&gt; never reaches BigQuery, so set the column in every write path or from a trigger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expire snapshots on a schedule.&lt;/strong&gt; BigLake keeps every snapshot in the table's &lt;code&gt;metadata.json&lt;/code&gt; and rejects that file above 1 MB, which a busy table reaches after a few thousand syncs. Spark's &lt;code&gt;expire_snapshots&lt;/code&gt; and &lt;code&gt;rewrite_data_files&lt;/code&gt; procedures work through the same catalog.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Oracle to BigQuery methods side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Datastream for Oracle&lt;/td&gt;
&lt;td&gt;near real time, by Google's description; from the redo log&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native BigQuery datasets, read by BigQuery only&lt;/td&gt;
&lt;td&gt;a connection profile and a stream, plus supplemental logging on Oracle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GoldenGate to BigQuery&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native BigQuery tables&lt;/td&gt;
&lt;td&gt;GoldenGate Extract and Replicat, a licensed Oracle option&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data Pump or CSV export, then &lt;code&gt;bq load&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads only&lt;/td&gt;
&lt;td&gt;native BigQuery tables&lt;/td&gt;
&lt;td&gt;a script, a scheduler and a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;varies by tool&lt;/td&gt;
&lt;td&gt;BigQuery tables, as a second copy&lt;/td&gt;
&lt;td&gt;nothing; per-row, per-GB or per-connector pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into BigLake (this post)&lt;/td&gt;
&lt;td&gt;incremental, on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;inserts and updates through the cursor; no deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables in your bucket that BigQuery, Spark, DuckDB, Trino and Flink read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Datastream is the simpler choice when deletes must replicate and BigQuery is the only reader. The cursor route fits when a read-only user is what you have, or when Spark, DuckDB or a notebook needs the same rows without a second copy.&lt;/p&gt;

&lt;p&gt;Skip it when hard deletes must reach BigQuery, or when a table has no steadily increasing column and cannot get one. It is also the wrong fit when every query has to run at native BigQuery speed, since a catalog table is read from Parquet in the bucket each time.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What happens to an Oracle table that has no primary key?
&lt;/h3&gt;

&lt;p&gt;It still syncs, but OLake Go has nothing to upsert on. Changed rows are appended, so an old version of a row sits next to the new one in BigQuery. Add a key in Oracle before the first sync if you want one row per key.&lt;/p&gt;

&lt;h3&gt;
  
  
  How often can the job run, and what does a run cost the Oracle server?
&lt;/h3&gt;

&lt;p&gt;The schedule goes down to one minute. Each run issues one range query per table on the cursor column, which is why the index on &lt;code&gt;UPDATED_AT&lt;/code&gt; matters. Only the first sync reads the tables in full.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does OLake Go spend BigQuery compute when it writes?
&lt;/h3&gt;

&lt;p&gt;No. OLake Go runs wherever you run Docker and uploads Parquet and delete files to the bucket with the service account's credentials. BigQuery bills only your queries, by bytes scanned on demand or by slot time on an edition, and the files are billed at Cloud Storage rates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your real schema, and check that every table you tick has a primary key and a cursor column the application always sets.&lt;/li&gt;
&lt;li&gt;The full guide has the command-line version of each step, the Spark connection and the complete data type table: &lt;a href="https://olake.io/docs/integrations/oracle-to-bigquery/" rel="noopener noreferrer"&gt;Oracle to BigQuery on olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your Oracle version, leave the error text in the comments and I'll update the tutorial.&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>bigquery</category>
    </item>
    <item>
      <title>Oracle to Snowflake Without GoldenGate: Incremental Sync on an updated_at Cursor</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Tue, 01 Dec 2026 19:01:51 +0000</pubDate>
      <link>https://dev.to/shubham_olake/oracle-to-snowflake-without-goldengate-incremental-sync-on-an-updatedat-cursor-2ib0</link>
      <guid>https://dev.to/shubham_olake/oracle-to-snowflake-without-goldengate-incremental-sync-on-an-updatedat-cursor-2ib0</guid>
      <description>&lt;p&gt;Most Oracle to Snowflake guides open by asking for the redo log. Oracle GoldenGate reads it under a license, and Debezium reads it through LogMiner with a Kafka cluster behind it. If all you were given is a read-only user, neither is on the table.&lt;/p&gt;

&lt;p&gt;What is left is usually a nightly spool to CSV and a &lt;code&gt;COPY INTO&lt;/code&gt;. It reloads whole tables, and it never shows an update as a change.&lt;/p&gt;

&lt;p&gt;The common ways to move Oracle data into Snowflake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.oracle.com/en/middleware/goldengate/core/23/" rel="noopener noreferrer"&gt;Oracle GoldenGate&lt;/a&gt; with its Snowflake handler:&lt;/strong&gt; reads the redo log and lands changes in native Snowflake tables within seconds, deletes included. You need the GoldenGate license, the handler and staging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium's Oracle connector, Kafka and the Snowflake Kafka connector:&lt;/strong&gt; seconds of latency from LogMiner, with deletes carried through the connector's tombstone handling. You operate Kafka, Kafka Connect, Debezium and a schema registry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT):&lt;/strong&gt; Fivetran, Estuary or Airbyte Cloud. Nothing to host and freshness in minutes by plan, but pricing is per row, per GB or per connector, and the rows land as a second copy inside Snowflake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual export:&lt;/strong&gt; a &lt;code&gt;SQL*Plus&lt;/code&gt; spool to CSV on a scheduler, then &lt;code&gt;COPY INTO&lt;/code&gt;. Hours to daily, and full reloads only.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The route below needs none of that, and it gives something up in return. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt; is an open source (Apache 2.0) tool that reads the tables over a plain Java Database Connectivity (JDBC) connection, copies each one in full, then on every later run fetches only the rows whose &lt;code&gt;updated_at&lt;/code&gt; moved. It writes them as Apache Iceberg tables into Horizon, the catalog built into every Snowflake account, so Snowsight shows them as Snowflake-managed tables.&lt;/p&gt;

&lt;p&gt;What it gives up: OLake Go has no log-based change data capture (CDC) for Oracle. The cursor column carries the changes, so a hard delete in Oracle never reaches Snowflake.&lt;/p&gt;

&lt;p&gt;I ran every step on 2026-10-29: Oracle Database 23ai Free in Docker, OLake Go v1.1.0 through OLake UI, and a Snowflake account on AWS ap-south-1. Every timing and row count below is from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Oracle to Snowflake pipeline looks like
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; two tables, &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, in a schema named &lt;code&gt;SHOP&lt;/code&gt;, read by a user that can only &lt;code&gt;SELECT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI and OLake Go in Docker Compose. The first sync reads each table in parallel chunks and records the highest cursor value it saw; later syncs select the rows above that value and upsert them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; a Snowflake database on Snowflake's own catalog and storage. No bucket, no stage and no external volume on your side.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Oracle Database 11g or later reachable over JDBC, a Snowflake account where you can run a one-time setup as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;, Docker, and about 30 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Give Oracle a read-only user and a cursor column
&lt;/h2&gt;

&lt;p&gt;Point OLake Go at tables you already have, or create the two from my run. They sit in the &lt;code&gt;SHOP&lt;/code&gt; schema of the pluggable database &lt;code&gt;FREEPDB1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;GENERATED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;GENERATED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="no"&gt;NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;VARCHAR2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Insert whatever rows you like. My run started with 8 customers and 40 orders. To replay step 7 as written, start with exactly 8 customers, two of them named Liam Carter and Zara Ali, so the ids line up.&lt;/p&gt;

&lt;p&gt;Three things have to be true before the first sync:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A read-only user&lt;/strong&gt; with &lt;code&gt;CREATE SESSION&lt;/code&gt; plus &lt;code&gt;SELECT&lt;/code&gt; on each table. Both the snapshot and the incremental syncs read the tables directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A cursor column&lt;/strong&gt; that grows with every change, such as &lt;code&gt;updated_at&lt;/code&gt;. Incremental syncs select &lt;code&gt;WHERE cursor &amp;gt; last value&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A primary key&lt;/strong&gt; on every table. OLake Go upserts on it, and without one the changed rows are appended instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run this as a database administrator (DBA):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- 1. A user for OLake Go&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="no"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SESSION&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- 2. Read access to the tables you sync&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ANY&lt;/span&gt; &lt;span class="no"&gt;DICTIONARY&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- lets discovery read the catalog views&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then check it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;all_users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;all_tables&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SHOP'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at the first query: the user is stored as &lt;code&gt;OLAKE&lt;/code&gt;, in upper case, because it was created without double quotes. That detail comes back in step 3.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Deletes do not replicate in incremental mode. A deleted row has no cursor value to read, so it stays in the Snowflake table. Soft-delete in Oracle with a &lt;code&gt;deleted_at&lt;/code&gt; column that also bumps &lt;code&gt;updated_at&lt;/code&gt;, or schedule an occasional full refresh.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Prepare Snowflake
&lt;/h2&gt;

&lt;p&gt;Paste this into a Snowsight worksheet as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;, once per account. It creates the database, the role OLake Go writes as, a service user, the network policy and the token.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;ACCOUNTADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;XSMALL&lt;/span&gt; &lt;span class="no"&gt;AUTO_SUSPEND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="no"&gt;AUTO_RESUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL_VOLUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE_MANAGED'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;SYSADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SERVICE&lt;/span&gt; &lt;span class="no"&gt;DEFAULT_ROLE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Snowflake issues a token to a service user only under a network policy.&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUBLIC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;RULE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_ip&lt;/span&gt;
  &lt;span class="no"&gt;MODE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;INGRESS&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;IPV4&lt;/span&gt; &lt;span class="no"&gt;VALUE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;OLake Go egress IP&amp;gt;/32'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;
  &lt;span class="no"&gt;ALLOWED_NETWORK_RULE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'OLAKE_DEMO.PUBLIC.olake_ip'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;NETWORK_POLICY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- The two values OLake Go asks for.&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ORGANIZATION_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'-'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ACCOUNT_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;account_identifier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="no"&gt;CURRENT_REGION&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- The token. Snowflake shows the secret once.&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="no"&gt;PROGRAMMATIC&lt;/span&gt; &lt;span class="no"&gt;ACCESS&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="no"&gt;OLAKE_PAT&lt;/span&gt;
  &lt;span class="no"&gt;ROLE_RESTRICTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_ROLE'&lt;/span&gt; &lt;span class="no"&gt;DAYS_TO_EXPIRY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy three things from the output: the &lt;code&gt;account_identifier&lt;/code&gt;, the &lt;code&gt;region&lt;/code&gt; and the token secret. On a laptop, &lt;code&gt;curl -s https://checkip.amazonaws.com&lt;/code&gt; prints the IP that goes into the network rule.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Leave out the network policy and the final statement fails with &lt;code&gt;Network Policy is required when creating a programmatic access token for user OLAKE_SVC&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The pair of &lt;code&gt;ALTER DATABASE&lt;/code&gt; statements is why nothing has to be registered later: every table OLake Go creates in &lt;code&gt;OLAKE_DEMO&lt;/code&gt; becomes a Snowflake-managed Iceberg table on Snowflake's own storage. &lt;code&gt;ROLE_RESTRICTION&lt;/code&gt; pins the token to &lt;code&gt;OLAKE_ROLE&lt;/code&gt;, so a leaked token cannot act as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add the Oracle source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and log in. Go to &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt;, pick &lt;strong&gt;Oracle&lt;/strong&gt; and give the source a name.&lt;/p&gt;

&lt;p&gt;My values: host &lt;code&gt;host.docker.internal&lt;/code&gt; because Oracle ran in another container, port &lt;code&gt;1521&lt;/code&gt;, connection type &lt;strong&gt;Service Name&lt;/strong&gt; with &lt;code&gt;FREEPDB1&lt;/code&gt;, and SSL mode &lt;code&gt;disable&lt;/code&gt;. A system identifier (SID) works as the connection type too. The &lt;strong&gt;Enable CDC&lt;/strong&gt; toggle is greyed out and labelled not supported, which is the form telling you the same thing as the intro.&lt;/p&gt;

&lt;p&gt;Type the username as &lt;code&gt;OLAKE&lt;/code&gt;, in upper case. OLake Go quotes the name when it connects, so Oracle compares it case-sensitively and &lt;code&gt;olake&lt;/code&gt; is a different user. My first attempt used lower case and the test came back with &lt;code&gt;ORA-01017: invalid credential or not authorized; logon denied&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. OLake Go tests the connection and saves the source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0k2b0yzmu7ycqcqzumyc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0k2b0yzmu7ycqcqzumyc.webp" alt="OLake UI source form for Oracle on OLake Go v1.1.0 with Enable CDC marked not supported, host host.docker.internal, port 1521, connection type Service Name, service name FREEPDB1 and username OLAKE" width="790" height="960"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Horizon destination
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt; and pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt;. Choose &lt;strong&gt;Horizon&lt;/strong&gt; as the catalog type and &lt;strong&gt;Programmatic Access Token (PAT)&lt;/strong&gt; as the authentication type, then fill in:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Horizon Iceberg REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake Database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;OLAKE_DEMO&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session Role Scope&lt;/td&gt;
&lt;td&gt;&lt;code&gt;session:role:OLAKE_ROLE&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Programmatic Access Token&lt;/td&gt;
&lt;td&gt;the secret from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud Storage Region&lt;/td&gt;
&lt;td&gt;the region from step 2, for example &lt;code&gt;AWS_AP_SOUTH_1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" alt="OLake UI destination form for the Snowflake Horizon catalog showing the programmatic access token authentication fields" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go calls the Horizon endpoint and exchanges the token before it saves, so a blocked IP or a wrong scope shows up here and not halfway through a sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. I named mine &lt;code&gt;oracle_to_snowflake&lt;/code&gt;, gave it a schedule and selected the source and destination from the last two steps.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Snowflake, plus DuckDB and Apache Spark if they will read the tables too. This is the only format decision in the whole setup. OLake Go works out which Iceberg delete format all the listed engines can read and sets it on every stream.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt; to reach the &lt;strong&gt;Streams&lt;/strong&gt; page and tick &lt;code&gt;CUSTOMERS&lt;/code&gt; and &lt;code&gt;ORDERS&lt;/code&gt; under &lt;code&gt;SHOP&lt;/code&gt;. Set the sync mode to &lt;strong&gt;Full Refresh + Incremental&lt;/strong&gt; with &lt;code&gt;UPDATED_AT&lt;/code&gt; as the cursor field, and the ingestion mode to &lt;strong&gt;Upsert&lt;/strong&gt;. Leave the &lt;strong&gt;Upsert Type&lt;/strong&gt; as resolved, which was Positional Deletes in my run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fstw5mo923dnk11v1plu2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fstw5mo923dnk11v1plu2.webp" alt="OLake UI Streams Selection page with the SHOP schema, CUSTOMERS and ORDERS ticked, sync mode Full Refresh + Incremental, cursor field UPDATED_AT, ingestion mode Upsert and upsert type Positional Deletes" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;. The first run copied 8 customers and 40 orders, 48 records in total, and finished in &lt;strong&gt;22 seconds&lt;/strong&gt; with container start included.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3hitvkfhymc2eu99v62.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3hitvkfhymc2eu99v62.webp" alt="OLake UI Job Logs and History for oracle_to_snowflake with two completed syncs, runtimes 22s and 17s" width="800" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The destination schema is named after the job and the source schema, lower-cased: &lt;code&gt;oracle_to_snowflake_shop&lt;/code&gt;. The &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page changes it before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in Snowsight
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;ICEBERG&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"oracle_to_snowflake_shop"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"city"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tier"&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"oracle_to_snowflake_shop"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"customers"&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There was no &lt;code&gt;CREATE ICEBERG TABLE&lt;/code&gt; and no refresh. &lt;code&gt;SHOW ICEBERG TABLES&lt;/code&gt; reports &lt;code&gt;catalog_name = SNOWFLAKE&lt;/code&gt;, &lt;code&gt;iceberg_table_type = MANAGED&lt;/code&gt; and &lt;code&gt;external_volume_name = SNOWFLAKE_MANAGED&lt;/code&gt; for both tables.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft7u7kbr64z1hv6x1ods7.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft7u7kbr64z1hv6x1ods7.webp" alt="Snowsight running SHOW ICEBERG TABLES on the oracle_to_snowflake_shop schema and listing customers and orders with owner OLAKE_ROLE, external volume SNOWFLAKE_MANAGED and table type MANAGED" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Keep the double quotes. OLake Go creates the schema and tables with lowercase names, and Snowflake upper-cases an unquoted identifier. The result is &lt;code&gt;Object 'OLAKE_DEMO.ORACLE_TO_SNOWFLAKE_SHOP.CUSTOMERS' does not exist or not authorized.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each table also gets four columns from OLake Go: &lt;code&gt;_olake_id&lt;/code&gt; (a hash of the primary key), &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt; and &lt;code&gt;_cdc_timestamp&lt;/code&gt;. After the first sync every &lt;code&gt;_op_type&lt;/code&gt; is &lt;code&gt;r&lt;/code&gt;, a snapshot row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in Oracle and sync again
&lt;/h2&gt;

&lt;p&gt;Between the two syncs I made 12 changes, 7 inserts and 5 updates. Note that every &lt;code&gt;UPDATE&lt;/code&gt; also sets &lt;code&gt;updated_at&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSTIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync fetched &lt;strong&gt;12 rows (598 bytes)&lt;/strong&gt; above the saved cursor and finished in &lt;strong&gt;17 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt; it wrote one data file with 4 rows: the 2 inserts plus the new versions of the 2 updated rows. One small delete file retires the 2 old versions, and &lt;code&gt;orders&lt;/code&gt; has the same shape with 8 rows and 3 deletes. The commit report in the sync log says so directly: &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedPositionalDeleteFiles=1&lt;/code&gt;, &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr75zipmu4q3wrhopsv9v.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr75zipmu4q3wrhopsv9v.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for customers and orders, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4 and 8, and totalEqualityDeletes 0" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now add &lt;code&gt;_op_type&lt;/code&gt; and &lt;code&gt;updated_at&lt;/code&gt; to the query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"city"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"_op_type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"updated_at"&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"oracle_to_snowflake_shop"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"customers"&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Snowflake returns 10 rows with no refresh. Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali moved to Abu Dhabi, and the two new customers are there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa4rd56tsm721izt4z0sf.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa4rd56tsm721izt4z0sf.webp" alt="Snowsight query on customers after the incremental sync returning 10 rows, with _op_type u for Liam Carter, Zara Ali, Maya Patel and Lucas Silva and r for the untouched snapshot rows" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing looks odd at first: the two brand-new customers carry &lt;code&gt;u&lt;/code&gt;, not &lt;code&gt;c&lt;/code&gt;. In incremental mode OLake Go cannot tell an insert from an update, so every row the second sync brought is marked &lt;code&gt;u&lt;/code&gt;. The untouched snapshot rows keep &lt;code&gt;r&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema changes.&lt;/strong&gt; A column added in Oracle shows up in Snowflake after the next sync. Narrowing or incompatible type changes fail the sync instead of corrupting the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB
&lt;/h2&gt;

&lt;p&gt;The files OLake Go wrote are open Iceberg tables behind Horizon's REST endpoint, so a second engine can read them with nothing exported or copied. DuckDB wants a bearer token instead of the raw PAT, so exchange it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -X POST &lt;span class="s2"&gt;"https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/x-www-form-urlencoded'&lt;/span&gt; \
  --data-urlencode &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials \
  --data-urlencode &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;session:role:OLAKE_ROLE \
  --data-urlencode &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;your PAT&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access_token from /v1/oauth/tokens&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_DEMO'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'vended_credentials'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oracle_to_snowflake_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhcnicuoirwj6jmh0bhpd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhcnicuoirwj6jmh0bhpd.webp" alt="DuckDB 1.5.5 shell querying horizon.oracle_to_snowflake_shop.customers and returning the same 10 rows as Snowflake" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers, and so did Spark 3.5.6 with Iceberg 1.10.0. An &lt;code&gt;orders&lt;/code&gt; roll-up by status matched Oracle to the cent in all three engines: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;p&gt;The session token lives about an hour, so re-run the exchange when DuckDB reports an authorization error. This path also needs a Snowflake account hosted on AWS or GCP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data types worth knowing
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Oracle&lt;/th&gt;
&lt;th&gt;Snowflake shows&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NUMBER(n,0)&lt;/code&gt;, n up to 9&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUMBER(10,0)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NUMBER(n,0)&lt;/code&gt;, n above 9&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUMBER(19,0)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;NUMBER(n,m)&lt;/code&gt; with a scale, &lt;code&gt;FLOAT&lt;/code&gt;, &lt;code&gt;BINARY_DOUBLE&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FLOAT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stored as doubles; round at query time for exact decimal arithmetic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;DATE&lt;/code&gt;, every &lt;code&gt;TIMESTAMP&lt;/code&gt; variant&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIMESTAMP_LTZ(6)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;UTC; an Oracle &lt;code&gt;DATE&lt;/code&gt; carries a time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;CLOB&lt;/code&gt;, &lt;code&gt;RAW&lt;/code&gt;, &lt;code&gt;BLOB&lt;/code&gt;, &lt;code&gt;INTERVAL&lt;/code&gt; types&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VARCHAR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;RAW&lt;/code&gt; and &lt;code&gt;BLOB&lt;/code&gt; arrive as text; keep large binaries out of the sync&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Snowflake side follows Snowflake's &lt;a href="https://docs.snowflake.com/en/user-guide/tables-iceberg-data-types" rel="noopener noreferrer"&gt;Iceberg data types&lt;/a&gt; page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Index the cursor.&lt;/strong&gt; Each incremental sync is one range scan per table on &lt;code&gt;updated_at&lt;/code&gt;, and an index keeps that scan cheap as the table grows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set the cursor in every write path.&lt;/strong&gt; An &lt;code&gt;UPDATE&lt;/code&gt; that leaves &lt;code&gt;updated_at&lt;/code&gt; alone is invisible to the next sync. A trigger that sets it on &lt;code&gt;UPDATE&lt;/code&gt; closes the gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put the token renewal on a calendar.&lt;/strong&gt; The setup asks for 30 days and Snowflake allows 365 at most. An expired token fails the next sync at the catalog handshake, before any data moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The network policy follows the token everywhere.&lt;/strong&gt; DuckDB or Spark reading through Horizon must also connect from an IP in &lt;code&gt;olake_ip&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for small files.&lt;/strong&gt; Snowflake compacts manifests on these tables at no cost, but data-file compaction is bundled only when Snowflake alone writes the table (&lt;a href="https://docs.snowflake.com/en/user-guide/tables-iceberg-manage" rel="noopener noreferrer"&gt;Snowflake docs&lt;/a&gt;). Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Horizon endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skip this route&lt;/strong&gt; when hard deletes must replicate, or when a table has no column that only ever increases. Without a cursor, only Full Refresh works.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the Oracle to Snowflake options compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GoldenGate with the Snowflake handler&lt;/td&gt;
&lt;td&gt;seconds, from the redo log&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native Snowflake tables&lt;/td&gt;
&lt;td&gt;GoldenGate (licensed), its handler and staging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka and the Snowflake Kafka connector&lt;/td&gt;
&lt;td&gt;seconds, from LogMiner&lt;/td&gt;
&lt;td&gt;yes, with tombstone handling&lt;/td&gt;
&lt;td&gt;Kafka topics, then Snowflake tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a schema registry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;yes, on plans with log-based Oracle capture&lt;/td&gt;
&lt;td&gt;Snowflake tables (a second copy)&lt;/td&gt;
&lt;td&gt;nothing; per-row, per-GB or per-connector pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spool to CSV plus &lt;code&gt;COPY INTO&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads&lt;/td&gt;
&lt;td&gt;files you control&lt;/td&gt;
&lt;td&gt;a script and a scheduler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into Horizon (this post)&lt;/td&gt;
&lt;td&gt;incremental, on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;inserts and updates that move the cursor; deletes need a soft-delete column&lt;/td&gt;
&lt;td&gt;Iceberg tables that Snowflake, DuckDB, Spark and Trino read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;GoldenGate is the pick when you need log-based capture with hard deletes and already hold the license. The cursor route earns its place when a read-only user is all you can get, or when a second engine needs the same rows without a second copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Which privileges does the Oracle user need?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;CREATE SESSION&lt;/code&gt; to log in and &lt;code&gt;SELECT&lt;/code&gt; on each table you sync. The setup also grants &lt;code&gt;SELECT ANY DICTIONARY&lt;/code&gt;, which lets discovery read the catalog views. Nothing in it touches the redo log or LogMiner.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens to a table without a primary key?
&lt;/h3&gt;

&lt;p&gt;It still syncs, but OLake Go has no key to upsert on. Changed rows are appended, so the old version of a row stays next to the new one. Add a primary key in Oracle before the first sync if you want one row per key in Snowflake.&lt;/p&gt;

&lt;h3&gt;
  
  
  How often can the job run, and what does each run cost Oracle?
&lt;/h3&gt;

&lt;p&gt;The schedule goes down to one minute. Each run is one range scan per table on the cursor column, which is why the index on &lt;code&gt;updated_at&lt;/code&gt; matters. Writing does not use a Snowflake warehouse, so Snowflake compute is spent only when you query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your real schema, and check that every table you tick has a primary key and a cursor column your application always sets.&lt;/li&gt;
&lt;li&gt;Want the files in your own S3 bucket? Use AWS Glue as the catalog; Snowflake then reads the tables through a read-only catalog integration that you refresh after each sync.&lt;/li&gt;
&lt;li&gt;The full guide, with the Glue variant, the Spark connection and the command-line version of every step, is on &lt;a href="https://olake.io/docs/integrations/oracle-to-snowflake/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your Oracle version, post the error text in the comments and I'll update the tutorial.&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>snowflake</category>
    </item>
    <item>
      <title>SQL Server to ClickHouse with CDC: A Step-by-Step Docker Tutorial</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Mon, 30 Nov 2026 18:58:03 +0000</pubDate>
      <link>https://dev.to/shubham_olake/sql-server-to-clickhouse-with-cdc-a-step-by-step-docker-tutorial-40a3</link>
      <guid>https://dev.to/shubham_olake/sql-server-to-clickhouse-with-cdc-a-step-by-step-docker-tutorial-40a3</guid>
      <description>&lt;p&gt;SQL Server to ClickHouse usually comes up when reports start slowing down the database that takes the orders. ClickHouse is built for those scans and group-bys, but the rows are still written in SQL Server and keep changing after the first copy. Every insert, update and delete has to follow them across.&lt;/p&gt;

&lt;p&gt;SQL Server already records those changes if you let it. Turn on change data capture (CDC) and a SQL Server Agent job copies each change from the transaction log into a change table. Pipelines differ in what reads those tables, and where the rows land.&lt;/p&gt;

&lt;h2&gt;
  
  
  The usual ways to move SQL Server data into ClickHouse
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and the ClickHouse Kafka engine.&lt;/strong&gt; Seconds of latency, but you run Kafka, Kafka Connect, the Debezium SQL Server connector and a materialized view per table, and updates and deletes need your own merge logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;a href="https://clickhouse.com/docs/reference/functions/table-functions/odbc" rel="noopener noreferrer"&gt;ClickHouse ODBC table function&lt;/a&gt;.&lt;/strong&gt; Nothing is copied: every query goes to SQL Server through an Open Database Connectivity (ODBC) driver and a data source name (DSN) on each ClickHouse server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export and load.&lt;/strong&gt; The &lt;code&gt;bcp&lt;/code&gt; utility or SQL Server Integration Services (SSIS) writes files, and &lt;code&gt;INSERT ... SELECT FROM s3(...)&lt;/code&gt; loads them. Hours to daily, full reloads only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load and transform (ELT).&lt;/strong&gt; Fivetran, Estuary or Airbyte Cloud. Nothing to host, minutes by plan, and a second copy in ClickHouse priced per row, per GB or per connector.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes a fifth route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt; is an open source (Apache 2.0) replication tool that reads the change tables and commits the rows as Apache Iceberg tables into an Apache Polaris catalog. ClickHouse attaches that catalog as a database, and DuckDB and Trino read the same tables from the same endpoint.&lt;/p&gt;

&lt;p&gt;I ran every step below on 2026-10-30, all in Docker: SQL Server 2022 Developer, OLake Go v1.1.0 through OLake UI, Polaris 1.8.0 on MinIO, and ClickHouse 26.8.36 LTS (long-term support). The timings and row counts in this post come from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the SQL Server to ClickHouse pipeline looks like
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; a database &lt;code&gt;shop&lt;/code&gt; with two CDC-enabled tables, &lt;code&gt;dbo.customers&lt;/code&gt; and &lt;code&gt;dbo.orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI on &lt;code&gt;localhost:8000&lt;/code&gt;. The first sync records the current log sequence number (LSN) and copies each table in parallel chunks; later syncs read the change tables from that LSN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Catalog:&lt;/strong&gt; Polaris, an open source Iceberg REST (Representational State Transfer) catalog, over a MinIO bucket called &lt;code&gt;lakehouse&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readers:&lt;/strong&gt; ClickHouse through its &lt;code&gt;DataLakeCatalog&lt;/code&gt; engine, plus DuckDB and Trino.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Docker, a SQL Server edition with CDC (Developer, Standard 2016 SP1 or later, or Enterprise), ClickHouse 26.1 or later, and about 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Turn on CDC in SQL Server
&lt;/h2&gt;

&lt;p&gt;If you want a throwaway server, start one with the Agent switched on. The capture job is an Agent job, and a container leaves the Agent off by default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d --name mssql \
  -e &lt;span class="nv"&gt;ACCEPT_EULA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Y \
  -e &lt;span class="nv"&gt;MSSQL_SA_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;a strong password&amp;gt;'&lt;/span&gt; \
  -e &lt;span class="nv"&gt;MSSQL_AGENT_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; \
  -p 1433:1433 \
  mcr.microsoft.com/mssql/server:2022-latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a database &lt;code&gt;shop&lt;/code&gt; and the two tables. My run started with 8 customers and 40 orders; insert whatever you like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="kt"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then enable CDC on the database and each table, and create a read-only login. The last block matters more than it looks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'customers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;STATE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- OLake Go reads the capture job definition from msdb&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdc_jobs&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm it took:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_cdc_enabled&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shop'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- 1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;capture_instance&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;change_tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;-- dbo_customers, dbo_orders&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_help_job&lt;/span&gt; &lt;span class="nd"&gt;@job_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'cdc.shop_capture'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;-- the Agent job exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a production server, keep four things in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No Agent, no changes.&lt;/strong&gt; A stopped Agent leaves the change tables empty, with no error. &lt;code&gt;EXEC master.dbo.xp_servicecontrol 'QueryState', 'SQLServerAgent'&lt;/code&gt; answers &lt;code&gt;Running.&lt;/code&gt; when it is up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three days of change rows.&lt;/strong&gt; A job paused longer needs a fresh snapshot, so raise retention with &lt;code&gt;sys.sp_cdc_change_job&lt;/code&gt; before a planned pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosted servers&lt;/strong&gt; use &lt;code&gt;msdb.dbo.rds_cdc_enable_db&lt;/code&gt; on Amazon Relational Database Service (RDS) or &lt;code&gt;msdb.dbo.gcloudsql_cdc_enable_db&lt;/code&gt; on Cloud SQL for the database step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary keys.&lt;/strong&gt; Without one, inserts replicate but updates and deletes are not applied.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Start Polaris and MinIO, then create the catalog
&lt;/h2&gt;

&lt;p&gt;Polaris stores pointers and permissions, not data. It hands short-lived storage credentials to OLake Go and to each engine, so no store keys need to sit in ClickHouse. Save this as &lt;code&gt;docker-compose.yml&lt;/code&gt; and run &lt;code&gt;docker compose up -d&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minio/minio&lt;/span&gt;
    &lt;span class="na"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lake-minio&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;server /data --console-address ":9001"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;MINIO_ROOT_USER:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;MINIO_ROOT_PASSWORD:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"9000:9000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"9001:9001"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apache/polaris:latest&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"8181:8181"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"8182:8182"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;AWS_REGION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;us-east-1&lt;/span&gt;
      &lt;span class="na"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;
      &lt;span class="na"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;
      &lt;span class="na"&gt;POLARIS_BOOTSTRAP_CREDENTIALS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POLARIS,root,&amp;lt;root-secret&amp;gt;&lt;/span&gt;
      &lt;span class="na"&gt;polaris.realm-context.realms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POLARIS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create the bucket, a catalog called &lt;code&gt;olake&lt;/code&gt;, a principal for OLake Go and the engines, and the grant that lets it write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;P&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:8181
aws --endpoint-url http://localhost:9000 s3 mb s3://lakehouse

&lt;span class="nv"&gt;TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;curl -s &lt;span class="nv"&gt;$P&lt;/span&gt;/api/catalog/v1/oauth/tokens -H &lt;span class="s1"&gt;'Polaris-Realm: POLARIS'&lt;/span&gt; \
  -d &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials -d &lt;span class="nv"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root -d &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;root-secret&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  -d &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;PRINCIPAL_ROLE:ALL &lt;span class="o"&gt;|&lt;/span&gt; jq -r .access_token&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;H&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;-H &lt;span class="s2"&gt;"Authorization: Bearer $TOKEN"&lt;/span&gt; -H &lt;span class="s1"&gt;'Polaris-Realm: POLARIS'&lt;/span&gt; -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs -d &lt;span class="s1"&gt;'{"catalog": {
  "name": "olake", "type": "INTERNAL", "readOnly": false,
  "properties": {"default-base-location": "s3://lakehouse/olake"},
  "storageConfigInfo": {"storageType": "S3", "allowedLocations": ["s3://lakehouse/olake"],
    "endpoint": "http://&amp;lt;minio-host&amp;gt;:9000/", "endpointInternal": "http://lake-minio:9000",
    "pathStyleAccess": true, "region": "us-east-1"}}}'&lt;/span&gt;

curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principals -d &lt;span class="s1"&gt;'{"principal": {"name": "olake"}}'&lt;/span&gt;

curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principal-roles -d &lt;span class="s1"&gt;'{"principalRole": {"name": "olake_role"}}'&lt;/span&gt;
curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs/olake/catalog-roles -d &lt;span class="s1"&gt;'{"catalogRole": {"name": "olake_catalog_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principals/olake/principal-roles -d &lt;span class="s1"&gt;'{"principalRole": {"name": "olake_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principal-roles/olake_role/catalog-roles/olake -d &lt;span class="s1"&gt;'{"catalogRole": {"name": "olake_catalog_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs/olake/catalog-roles/olake_catalog_role/grants -d &lt;span class="s1"&gt;'{"type": "catalog", "privilege": "CATALOG_MANAGE_CONTENT"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three details in that block decide whether ClickHouse can read anything later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The slash at the end of &lt;code&gt;endpoint&lt;/code&gt;.&lt;/strong&gt; ClickHouse 26.8 and 26.10 build the object path from this value. Without the trailing slash, every read returns a 404.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No underscores in hostnames.&lt;/strong&gt; Polaris is a Java service, and Java's URI parser rejects a host such as &lt;code&gt;lab_minio&lt;/code&gt;. That is why the container is &lt;code&gt;lake-minio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The principal's secret appears once,&lt;/strong&gt; in the response to the &lt;code&gt;principals&lt;/code&gt; call. Copy the &lt;code&gt;clientId&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt; now.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add the SQL Server source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in with &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;password&lt;/code&gt;. Under &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and pick &lt;strong&gt;MSSQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on, and leave &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; off unless you want to grant &lt;code&gt;db_owner&lt;/code&gt;. SQL Server ran in another container, so the host is &lt;code&gt;host.docker.internal&lt;/code&gt; on port &lt;code&gt;1433&lt;/code&gt;, with database &lt;code&gt;shop&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt; and SSL off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F68znkt4exh8zxq3dzpnw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F68znkt4exh8zxq3dzpnw.webp" alt="OLake UI Edit source form for MSSQL on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal, port 1433, database shop, user olake and SSL disabled" width="795" height="1045"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up source&lt;/strong&gt; tests the connection and then the CDC prerequisites before saving: CDC on the database, a capture instance per table, and a capture job it can read. A failed check names the setting and what to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Polaris destination
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;, pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt; and set the catalog type to &lt;strong&gt;Polaris&lt;/strong&gt; with &lt;strong&gt;OAuth2&lt;/strong&gt; authentication. The values from my run:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:8181/api/catalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polaris Catalog Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;olake&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST Auth URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:8181/api/catalog/v1/oauth/tokens&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST Credential&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;client_id&amp;gt;:&amp;lt;client_secret&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST scope&lt;/td&gt;
&lt;td&gt;&lt;code&gt;PRINCIPAL_ROLE:ALL&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S3 Endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:9000&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Region&lt;/td&gt;
&lt;td&gt;&lt;code&gt;us-east-1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Add the MinIO access and secret keys, then click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go exchanges the credential for a token, creates a namespace and a test table, writes to the bucket and drops the test table again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjslvz94axxvwqm1pp7zg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjslvz94axxvwqm1pp7zg.webp" alt="OLake UI Edit destination form for Apache Iceberg with catalog type Polaris, OAuth2 authentication, the REST catalog URI on port 8181, catalog name olake and the MinIO S3 endpoint on port 9000" width="768" height="1018"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Jobs&lt;/strong&gt;, click &lt;strong&gt;Create Job&lt;/strong&gt;, name it &lt;code&gt;sql_server_to_clickhouse&lt;/code&gt; and pick the source and destination. The schedule sets how often the change tables are drained, not how often a full copy runs.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to ClickHouse, DuckDB and Trino. That is the only format decision you make: OLake Go works out a delete format all three read, and with ClickHouse in the list it chose equality deletes.&lt;/p&gt;

&lt;p&gt;On the &lt;strong&gt;Streams&lt;/strong&gt; page, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt; with &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and &lt;strong&gt;Upsert&lt;/strong&gt;. Leave &lt;code&gt;systranschemas&lt;/code&gt; unticked; enabling CDC added it, it has no capture instance, and selecting it fails the first sync.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5hq2lao62s3a09rfg9zg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5hq2lao62s3a09rfg9zg.webp" alt="OLake UI Streams Selection page with customers and orders selected in the dbo schema, systranschemas unticked, sync mode Full Refresh + CDC, Upsert, and Equality Deletes on Iceberg format version V2" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then &lt;strong&gt;Sync Now&lt;/strong&gt; from the job's menu. My first sync copied 48 records (3.05 KB) in &lt;strong&gt;17 seconds&lt;/strong&gt;, container start included.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flq6rek41cqvnliow087n.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flq6rek41cqvnliow087n.webp" alt="OLake UI job history for sql_server_to_clickhouse with two completed syncs, the first taking 17 seconds and the second 9 seconds" width="800" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The namespace is built from the job, the source database and the schema: &lt;code&gt;sql_server_to_clickhouse_shop_dbo&lt;/code&gt;. To pick another name, change the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in ClickHouse
&lt;/h2&gt;

&lt;p&gt;No table needs registering. In &lt;code&gt;clickhouse-client&lt;/code&gt;, attach the whole catalog once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;allow_database_iceberg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;
&lt;span class="no"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DataLakeCatalog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;SETTINGS&lt;/span&gt;
  &lt;span class="n"&gt;catalog_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'rest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;warehouse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'olake'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;catalog_credential&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_id&amp;gt;:&amp;lt;client_secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;oauth_server_uri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog/v1/oauth/tokens'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;auth_scope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'PRINCIPAL_ROLE:ALL'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;vended_credentials&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'us-east-1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="sb"&gt;`sql_server_to_clickhouse_shop_dbo.customers`&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ClickHouse has one level of namespace, so the Iceberg namespace and the table name share one pair of backticks. The database is read-only.&lt;/p&gt;

&lt;p&gt;OLake Go adds &lt;code&gt;_olake_id&lt;/code&gt;, &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt; and &lt;code&gt;_cdc_timestamp&lt;/code&gt; to every table, and &lt;code&gt;_cdc_start_lsn&lt;/code&gt; and &lt;code&gt;_cdc_seqval&lt;/code&gt;, the log position of each change, to SQL Server tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in SQL Server and sync again
&lt;/h2&gt;

&lt;p&gt;This is the part a nightly export cannot do. I made 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second sync read &lt;strong&gt;12 records (855 bytes)&lt;/strong&gt; from the change tables in &lt;strong&gt;9 seconds&lt;/strong&gt;. For &lt;code&gt;customers&lt;/code&gt; it wrote one data file with 4 rows (2 inserts, 2 new versions) and one equality delete file covering all 4 keys. Deletes for the inserted keys are harmless, since no older row matches them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9sanhhdpcbt38pnxhmor.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9sanhhdpcbt38pnxhmor.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for customers and orders, with addedDataFiles 1, addedEqualityDeleteFiles 1, addedRecords 4 and 8, and addedEqualityDeletes 4 and 8" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the same &lt;code&gt;SELECT&lt;/code&gt; again, with no refresh. Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali is in Abu Dhabi, Maya and Lucas are new, and there is still one row per key: ClickHouse applies the equality deletes while it reads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz5gzmo6jij9mzv4aml3x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz5gzmo6jij9mzv4aml3x.webp" alt="clickhouse-client output for polaris sql_server_to_clickhouse_shop_dbo.customers after the change sync, 10 rows with Liam Carter as gold and Zara Ali in Abu Dhabi" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_op_type&lt;/code&gt; tells you how each row arrived: &lt;code&gt;r&lt;/code&gt; from the snapshot, &lt;code&gt;c&lt;/code&gt; for an insert, &lt;code&gt;u&lt;/code&gt; for an update. The capture job runs every few seconds, so a write made just before a sync starts may only show up in the next one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB and Trino
&lt;/h2&gt;

&lt;p&gt;Nothing is exported. DuckDB 1.5.5 attaches the same catalog:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;polaris_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;CLIENT_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CLIENT_SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;OAUTH2_SERVER_URI&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog/v1/oauth/tokens'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;OAUTH2_SCOPE&lt;/span&gt; &lt;span class="s1"&gt;'PRINCIPAL_ROLE:ALL'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;store_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;secret key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;minio-host&amp;gt;:9000'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;URL_STYLE&lt;/span&gt; &lt;span class="s1"&gt;'path'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;USE_SSL&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;REGION&lt;/span&gt; &lt;span class="s1"&gt;'us-east-1'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'olake'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;polaris_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_clickhouse_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbb4eor3cgkw1d6eiz21v.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbb4eor3cgkw1d6eiz21v.webp" alt="DuckDB 1.5.5 querying polaris.sql_server_to_clickhouse_shop_dbo.customers and returning the same 10 rows that ClickHouse returned" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trino 484 needs one catalog file with &lt;code&gt;connector.name=iceberg&lt;/code&gt;, &lt;code&gt;iceberg.catalog.type=rest&lt;/code&gt; and the same OAuth2 credential, and it returned the same 10 rows. An &lt;code&gt;orders&lt;/code&gt; roll-up matched SQL Server to the cent in all three engines: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Money becomes a double.&lt;/strong&gt; &lt;code&gt;decimal&lt;/code&gt;, &lt;code&gt;numeric&lt;/code&gt; and &lt;code&gt;money&lt;/code&gt; arrive in ClickHouse as &lt;code&gt;Float64&lt;/code&gt;. The sums matched, but round at query time when you need exact decimal arithmetic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dates land in UTC.&lt;/strong&gt; &lt;code&gt;datetime2&lt;/code&gt; has no zone in SQL Server and is read as UTC, showing up as &lt;code&gt;DateTime64(6, 'UTC')&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New columns need a new capture instance.&lt;/strong&gt; Create one by hand, or turn on &lt;strong&gt;Manage Capture Instance&lt;/strong&gt;. OLake Go then adds the column on the next sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan compaction.&lt;/strong&gt; Each sync adds a small data file and a delete file per table, and nothing merges them for you. Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Polaris endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the SQL Server to ClickHouse options compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, ClickHouse Kafka engine&lt;/td&gt;
&lt;td&gt;Seconds&lt;/td&gt;
&lt;td&gt;Yes, with your own merge logic&lt;/td&gt;
&lt;td&gt;Kafka topics, then ClickHouse tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a materialized view per table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ODBC table function&lt;/td&gt;
&lt;td&gt;Live, per query&lt;/td&gt;
&lt;td&gt;Reads the current row&lt;/td&gt;
&lt;td&gt;Nothing copied; queries hit SQL Server&lt;/td&gt;
&lt;td&gt;An ODBC driver and DSN on every ClickHouse server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;bcp&lt;/code&gt; or SSIS export, then &lt;code&gt;INSERT ... SELECT FROM s3(...)&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Hours to daily&lt;/td&gt;
&lt;td&gt;No, full reloads&lt;/td&gt;
&lt;td&gt;Native ClickHouse tables&lt;/td&gt;
&lt;td&gt;A script, a scheduler, a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;Minutes, by plan&lt;/td&gt;
&lt;td&gt;Varies by tool&lt;/td&gt;
&lt;td&gt;A second copy in ClickHouse&lt;/td&gt;
&lt;td&gt;Nothing; priced per row, GB or connector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go to Polaris (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;Yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables ClickHouse, DuckDB, Trino and Spark read&lt;/td&gt;
&lt;td&gt;One Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With Kafka already running and a need for seconds of latency into MergeTree, Debezium is the simpler pick. A &lt;code&gt;DataLakeCatalog&lt;/code&gt; query reads Parquet with no primary index, so load a hot slice into MergeTree on a schedule for dashboards that need it. Express and Web editions have no CDC and are limited to Full Refresh or Full Refresh + Incremental on an &lt;code&gt;updated_at&lt;/code&gt; column.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I swap MinIO for Amazon S3?
&lt;/h3&gt;

&lt;p&gt;Yes. Create the catalog against an S3 bucket with an IAM (Identity and Access Management) role, and leave both &lt;code&gt;endpoint&lt;/code&gt; and &lt;code&gt;endpointInternal&lt;/code&gt; out of &lt;code&gt;storageConfigInfo&lt;/code&gt;. In the OLake Go destination, leave the S3 endpoint empty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can ClickHouse write back into the polaris database?
&lt;/h3&gt;

&lt;p&gt;No. The &lt;code&gt;DataLakeCatalog&lt;/code&gt; database is read-only, and &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt; and &lt;code&gt;RENAME DATABASE&lt;/code&gt; return &lt;code&gt;NOT_IMPLEMENTED&lt;/code&gt;. To speed up a hot query, select from it into a MergeTree table of your own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do deletes in SQL Server reach ClickHouse?
&lt;/h3&gt;

&lt;p&gt;Yes. The capture job writes deletes to the change tables like any other change, and the next sync replays them, with &lt;code&gt;_op_type&lt;/code&gt; set to &lt;code&gt;d&lt;/code&gt;. That only works on tables with a primary key; without one, updates and deletes cannot be matched to a row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own SQL Server. On RDS or Cloud SQL, only the database-level CDC procedure changes.&lt;/li&gt;
&lt;li&gt;To add a table, run &lt;code&gt;sys.sp_cdc_enable_table&lt;/code&gt; for it, then tick it on the job's Streams page.&lt;/li&gt;
&lt;li&gt;The full guide, with the data type table, the Trino catalog file and the troubleshooting list, is the &lt;a href="https://olake.io/docs/integrations/sql-server-to-clickhouse/" rel="noopener noreferrer"&gt;SQL Server to ClickHouse integration page&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently for you, leave a comment with the message you got and I will update the post.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>clickhouse</category>
    </item>
    <item>
      <title>SQL Server to Redshift: Replicate Change Tables Through AWS Glue, Step by Step</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Mon, 30 Nov 2026 04:06:37 +0000</pubDate>
      <link>https://dev.to/shubham_olake/sql-server-to-redshift-replicate-change-tables-through-aws-glue-step-by-step-2f4n</link>
      <guid>https://dev.to/shubham_olake/sql-server-to-redshift-replicate-change-tables-through-aws-glue-step-by-step-2f4n</guid>
      <description>&lt;p&gt;Moving SQL Server to Redshift is easy once and tedious after that. A &lt;code&gt;bcp&lt;/code&gt; export, an upload to Amazon S3 and a &lt;code&gt;COPY&lt;/code&gt; land one table, and a row updated at lunch keeps its old value in Redshift until the next full reload.&lt;/p&gt;

&lt;p&gt;SQL Server already records what changed. With change data capture (CDC) on, the SQL Server Agent copies every insert, update and delete from the transaction log into change tables, so the open question is who reads them and where the rows go.&lt;/p&gt;

&lt;p&gt;The usual ways to wire this up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bcp&lt;/code&gt; export, then &lt;code&gt;COPY&lt;/code&gt;.&lt;/strong&gt; The bulk copy program writes files, a script stages them in S3, and Redshift's &lt;code&gt;COPY&lt;/code&gt; loads them. Freshness is hours to daily, and changes only show up through full reloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Redshift.html" rel="noopener noreferrer"&gt;AWS Database Migration Service (DMS)&lt;/a&gt;.&lt;/strong&gt; A replication instance and a task read SQL Server's log or its CDC tables and apply the changes to native Redshift tables, through an S3 staging bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and a Redshift sink.&lt;/strong&gt; The &lt;a href="https://debezium.io/documentation/reference/stable/connectors/sqlserver.html" rel="noopener noreferrer"&gt;Debezium SQL Server connector&lt;/a&gt; streams the change tables into Kafka within seconds, and a sink writes them to Redshift. You run Kafka, Kafka Connect and both connectors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes a fourth route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, drains the change tables on a schedule and commits Apache Iceberg tables into the AWS Glue Data Catalog, with the files in your own bucket. Redshift queries them in place through an external schema, and Athena and DuckDB open the same files.&lt;/p&gt;

&lt;p&gt;I ran every step on 2026-10-30 with SQL Server 2022 Developer in Docker, OLake Go v1.1.0 in OLake UI, and a Redshift Serverless workgroup at 8 Redshift Processing Units (RPU) in &lt;code&gt;ap-southeast-1&lt;/code&gt;. Every timing and row count below comes from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  The SQL Server to Redshift setup at a glance
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; database &lt;code&gt;shop&lt;/code&gt; with &lt;code&gt;dbo.customers&lt;/code&gt; and &lt;code&gt;dbo.orders&lt;/code&gt;, CDC on for both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Writer:&lt;/strong&gt; OLake Go in Docker Compose. The first sync saves the current log sequence number (LSN) and copies each table in parallel chunks; later syncs read the change tables from that LSN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Catalog and storage:&lt;/strong&gt; a Glue database per job, with Parquet data and delete files in S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readers:&lt;/strong&gt; Redshift through an external schema, plus Athena and DuckDB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Before you start:&lt;/strong&gt; SQL Server 2016 SP1 or later (Developer, Standard or Enterprise) with the Agent running, an AWS account, Redshift Serverless or an RA3 cluster, Docker, and about 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Turn on CDC in SQL Server
&lt;/h2&gt;

&lt;p&gt;Point OLake Go at your own tables if you have them. To reproduce this run, create these two in a database named &lt;code&gt;shop&lt;/code&gt; and insert some rows; I started with 8 customers and 40 orders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="kt"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, switch CDC on for the database and for each table, and give OLake Go a login of its own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- @role_name = NULL skips the gating role&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'customers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;STATE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- the source test reads the capture job definition from msdb&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdc_jobs&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm all three pieces exist before going further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_cdc_enabled&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shop'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- 1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;capture_instance&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;change_tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;-- dbo_customers, dbo_orders&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_help_job&lt;/span&gt; &lt;span class="nd"&gt;@job_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'cdc.shop_capture'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;-- the Agent job exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a production server, four details matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Agent fills the change tables.&lt;/strong&gt; When it is stopped, nothing new lands in &lt;code&gt;cdc.*&lt;/code&gt; and SQL Server reports no error. Amazon RDS and Azure SQL Managed Instance run it by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retention is three days by default.&lt;/strong&gt; A job paused for longer needs a fresh snapshot; &lt;code&gt;sys.sp_cdc_change_job @job_type = 'cleanup'&lt;/code&gt; raises it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon RDS for SQL Server&lt;/strong&gt; enables the database with &lt;code&gt;EXEC msdb.dbo.rds_cdc_enable_db 'shop'&lt;/code&gt;. The table step and the login stay the same.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each table needs a primary key.&lt;/strong&gt; Without one, inserts replicate but updates and deletes are not applied.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Set up S3, an IAM user and the Redshift role
&lt;/h2&gt;

&lt;p&gt;Create three things in AWS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An S3 bucket&lt;/strong&gt; in the region your engines run in. Mine was in &lt;code&gt;ap-southeast-1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An Identity and Access Management (IAM) user for OLake Go&lt;/strong&gt; with an access key pair. I scoped it with this inline policy:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:GetBucketLocation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;bucket&amp;gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:PutObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:DeleteObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:AbortMultipartUpload"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:ListMultipartUploadParts"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;bucket&amp;gt;/*"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetDatabases"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:CreateDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetTables"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:CreateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:UpdateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:DeleteTable"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:catalog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:database/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:table/*/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An IAM role for Redshift,&lt;/strong&gt; attached to the Serverless namespace or the RA3 cluster. Mine carried &lt;code&gt;AmazonS3ReadOnlyAccess&lt;/code&gt; plus read access to Glue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Leave Glue alone for now. OLake Go creates the database during the first sync and registers both tables in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Run OLake UI and connect SQL Server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Browse to &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in as &lt;code&gt;admin&lt;/code&gt; with the password &lt;code&gt;password&lt;/code&gt;. Open &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt;, choose &lt;strong&gt;MSSQL&lt;/strong&gt;, name it and keep the OLake Go version on the latest release.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Change data capture (CDC)&lt;/strong&gt;, keep &lt;strong&gt;Enable CDC&lt;/strong&gt; on. &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; lets OLake Go create a new capture instance after a schema change, but it needs &lt;code&gt;db_owner&lt;/code&gt;, so I left it off.&lt;/p&gt;

&lt;p&gt;For the connection I used host &lt;code&gt;host.docker.internal&lt;/code&gt;, because SQL Server ran in a separate container, with port &lt;code&gt;1433&lt;/code&gt;, database &lt;code&gt;shop&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt; and SSL disabled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzhekl975zanoas8pffph.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzhekl975zanoas8pffph.webp" alt="OLake UI Edit source form for MSSQL on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal, port 1433, database shop, user olake and SSL disabled" width="795" height="1045"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up source&lt;/strong&gt; also checks CDC on the database, a capture instance per table and a readable capture job. When one fails, the dialog names the setting and what to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Glue destination
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;, choose &lt;strong&gt;Apache Iceberg&lt;/strong&gt; and set the catalog type to &lt;strong&gt;AWS Glue&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What I entered&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;S3 Path&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s3://&amp;lt;bucket&amp;gt;/lakehouse/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Region&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ap-southeast-1&lt;/code&gt;, where both the bucket and the Glue catalog live&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Access Key, AWS Secret Key&lt;/td&gt;
&lt;td&gt;the key pair of the IAM user from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0725eleleal6n9tstby.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0725eleleal6n9tstby.webp" alt="OLake UI Edit destination form for Apache Iceberg with catalog type AWS Glue, an S3 path under the lab bucket, region ap-southeast-1 and an access key pair" width="768" height="859"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. On an instance that has its own IAM role, leave both key fields empty and OLake Go uses the role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Redshift is not in OLake Go's target engine picker yet, and that changes one setting on this job.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Jobs&lt;/strong&gt;, click &lt;strong&gt;Create Job&lt;/strong&gt;, name it &lt;code&gt;sql_server_to_redshift&lt;/code&gt; and pick a schedule.&lt;/li&gt;
&lt;li&gt;Select the source from step 3 and the destination from step 4.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to AWS Athena and DuckDB.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt; and leave &lt;code&gt;systranschemas&lt;/code&gt; unticked.&lt;/li&gt;
&lt;li&gt;For each table, set &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and &lt;strong&gt;Upsert&lt;/strong&gt;, with &lt;strong&gt;Positional Deletes&lt;/strong&gt; as the upsert type.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then choose &lt;strong&gt;Sync Now&lt;/strong&gt; from the job's menu.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Positional deletes are what Redshift reads, and Athena and DuckDB read them as well. The &lt;code&gt;systranschemas&lt;/code&gt; table appears because enabling CDC adds it to the database, and it has no capture instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft0f6yt0ynqq4eyx6bxz8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft0f6yt0ynqq4eyx6bxz8.webp" alt="OLake UI Streams Selection page with the dbo schema, customers and orders selected and systranschemas unticked, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Positional Deletes on Iceberg format version V2" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first run copied 48 records (3.05 KB) in &lt;strong&gt;18 seconds&lt;/strong&gt;, container start included. The Glue database name joins the job, the source database and the schema, so mine is &lt;code&gt;sql_server_to_redshift_shop_dbo&lt;/code&gt;; the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page renames it before that first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in Redshift
&lt;/h2&gt;

&lt;p&gt;Open Redshift query editor v2 on the workgroup or cluster and map the Glue database once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;DATA&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt;
&lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="s1"&gt;'sql_server_to_redshift_shop_dbo'&lt;/span&gt;
&lt;span class="no"&gt;IAM_ROLE&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(amount), 2) AS total
FROM lakehouse.orders GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;IAM_ROLE default&lt;/code&gt; picks up the default role of the namespace or cluster; put a role ARN there if you keep several. Run this after the first sync and in the workgroup's region, since the Glue database does not exist before then.&lt;/p&gt;

&lt;p&gt;The schema is read-only from Redshift's side. OLake Go writes the tables, so an &lt;code&gt;INSERT&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; against them fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in SQL Server and sync again
&lt;/h2&gt;

&lt;p&gt;This is where an export script falls behind. Back in SQL Server, make 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; again. OLake Go read &lt;strong&gt;12 records (855 bytes)&lt;/strong&gt; from the change tables in &lt;strong&gt;13 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5e50r1fghd7u4hfhbnau.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5e50r1fghd7u4hfhbnau.webp" alt="OLake UI Job Logs and History for sql_server_to_redshift showing two completed syncs, the first in 18 seconds and the second in 13 seconds" width="800" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;customers&lt;/code&gt; got one data file with 4 rows (2 inserts, plus new versions of the 2 updated customers) and one positional delete file retiring the 2 old versions. &lt;code&gt;orders&lt;/code&gt; got 8 rows and 3 deletes in the same shape.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8p93p4gtcjtmowkrbazo.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8p93p4gtcjtmowkrbazo.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for customers and orders, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4 and 8, and addedPositionalDeletes 2 and 3" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Re-run the customers query with no refresh and no &lt;code&gt;ALTER TABLE&lt;/code&gt; first. Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali lives in Abu Dhabi, the two new customers are there, and Redshift returns one row per key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8w3qxz3ged7d0bi4f8p0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8w3qxz3ged7d0bi4f8p0.webp" alt="Redshift query editor v2 in the AWS console running the customers query on the Serverless workgroup and returning 10 rows with id, name, city and tier" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;_op_type&lt;/code&gt; to the select to see how each row arrived: &lt;code&gt;r&lt;/code&gt; on the 6 untouched snapshot rows, &lt;code&gt;c&lt;/code&gt; on the 2 inserts and &lt;code&gt;u&lt;/code&gt; on the 2 updates. A deleted row would carry &lt;code&gt;d&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from Athena and DuckDB
&lt;/h2&gt;

&lt;p&gt;No export runs here: both engines open the files OLake Go committed, through the same Glue database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Athena&lt;/strong&gt; lists the database with no registration. Pick a workgroup with a query result location in S3, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sql_server_to_redshift_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(amount), 2) AS total
FROM sql_server_to_redshift_shop_dbo.orders GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fezhmv1gu0u13zyq73gzx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fezhmv1gu0u13zyq73gzx.webp" alt="Athena query editor in the AWS console showing the customers query on sql_server_to_redshift_shop_dbo.customers completed with 10 rows" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DuckDB&lt;/strong&gt; scans a table from its current metadata file, which Glue keeps as &lt;code&gt;metadata_location&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws glue get-table --database-name sql_server_to_redshift_shop_dbo --name customers \
  --query &lt;span class="s1"&gt;'Table.Parameters.metadata_location'&lt;/span&gt; --output text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;lake&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;secret key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;REGION&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;region&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nf"&gt;iceberg_scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'s3://&amp;lt;bucket&amp;gt;/lakehouse/sql_server_to_redshift_shop_dbo.db/customers/metadata/&amp;lt;latest&amp;gt;.metadata.json'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 gave back the same 10 customers. The &lt;code&gt;orders&lt;/code&gt; roll-up matched SQL Server to the cent in all three engines: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A fresh write can miss a sync.&lt;/strong&gt; The capture job fills the change tables every few seconds, so a change made right before &lt;strong&gt;Sync Now&lt;/strong&gt; may land in the next run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decimals become &lt;code&gt;DOUBLE PRECISION&lt;/code&gt;.&lt;/strong&gt; My sums still matched to the cent, but round at query time when exact decimal arithmetic matters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dates arrive as &lt;code&gt;TIMESTAMP&lt;/code&gt; in UTC,&lt;/strong&gt; and a &lt;code&gt;uniqueidentifier&lt;/code&gt; arrives as its 36-character text form.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New columns need a new capture instance.&lt;/strong&gt; Create one, or turn on &lt;strong&gt;Manage Capture Instance&lt;/strong&gt;, and the column reaches Redshift after the next sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan compaction.&lt;/strong&gt; Each sync adds a small data file and a delete file per table, and Glue does not compact tables written by external engines. Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; on Amazon Elastic MapReduce (EMR) or OLake Fusion handles it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SQL Server to Redshift methods side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;How fresh&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where rows land&lt;/th&gt;
&lt;th&gt;What you operate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;bcp&lt;/code&gt; to CSV, then &lt;code&gt;COPY&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;full reloads only&lt;/td&gt;
&lt;td&gt;native Redshift tables&lt;/td&gt;
&lt;td&gt;a script, a scheduler, a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS DMS&lt;/td&gt;
&lt;td&gt;CDC from the log or the CDC tables&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native Redshift tables&lt;/td&gt;
&lt;td&gt;a replication instance and task, plus S3 staging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, Redshift sink&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with the sink's upsert settings&lt;/td&gt;
&lt;td&gt;Kafka topics, then Redshift tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a sink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go to Glue (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables Redshift, Athena, EMR, Spark and DuckDB read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When native Redshift tables are the only goal and you are already on AWS, DMS is simpler. Writing Iceberg once wins when Athena, EMR or a notebook needs the same rows, or when you want to own the files.&lt;/p&gt;

&lt;p&gt;It is the wrong tool in three cases. Queries that must run at native Redshift speed suffer, because Redshift Spectrum scans the Parquet in S3 on every read; load the hot slice into a native table on a schedule. SQL Server Express and Web have no CDC at all, and tables with no primary key only ever get inserts.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Do I have to refresh anything in Redshift after each sync?
&lt;/h3&gt;

&lt;p&gt;No. Each sync ends with one commit that moves the table's metadata pointer in Glue, and Redshift reads that pointer on its next query. There is no &lt;code&gt;ALTER TABLE&lt;/code&gt; and no refresh command.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if the job is paused over a long weekend?
&lt;/h3&gt;

&lt;p&gt;The cleanup job drops change rows older than three days by default. A longer pause loses the job's position and forces a new snapshot, so raise retention with &lt;code&gt;sys.sp_cdc_change_job&lt;/code&gt; first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is a provisioned cluster fine, or only Serverless?
&lt;/h3&gt;

&lt;p&gt;Both work. Redshift Serverless and RA3 clusters read the Glue Data Catalog through an external schema; attach the IAM role to the cluster instead of the namespace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at a real database.&lt;/li&gt;
&lt;li&gt;Add a table with &lt;code&gt;sys.sp_cdc_enable_table&lt;/code&gt;, then tick it on the job's Streams page.&lt;/li&gt;
&lt;li&gt;The full guide, with the command line config, the data type table and every troubleshooting entry, is on &lt;a href="https://olake.io/docs/integrations/sql-server-to-redshift/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If one of these steps answers you with a different message, paste it in the comments and I will dig into it.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>redshift</category>
    </item>
    <item>
      <title>SQL Server to Databricks With CDC: From sp_cdc_enable_db to a Unity Catalog Query</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Sun, 29 Nov 2026 06:10:49 +0000</pubDate>
      <link>https://dev.to/shubham_olake/sql-server-to-databricks-with-cdc-from-spcdcenabledb-to-a-unity-catalog-query-3i0h</link>
      <guid>https://dev.to/shubham_olake/sql-server-to-databricks-with-cdc-from-spcdcenabledb-to-a-unity-catalog-query-3i0h</guid>
      <description>&lt;p&gt;Copying a table from SQL Server to Databricks once is easy. Keeping that copy current is the hard part: an order flips to &lt;code&gt;delivered&lt;/code&gt;, a customer moves city, and Databricks keeps the old value until the next full export. Deletes are worse: an incremental file load has no way to say that a row went away, so you fall back to reloading the whole table.&lt;/p&gt;

&lt;p&gt;SQL Server ships its own change feed. Change data capture (CDC) has the SQL Server Agent read the transaction log and write every change into a change table per tracked table, such as &lt;code&gt;cdc.dbo_customers_CT&lt;/code&gt;. The open question is what reads those tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ways to move SQL Server data into Databricks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bcp&lt;/code&gt; export, then Auto Loader.&lt;/strong&gt; The bulk copy utility writes each table to files in a bucket, and &lt;a href="https://docs.databricks.com/gcp/en/ingestion/cloud-object-storage/auto-loader/" rel="noopener noreferrer"&gt;Auto Loader&lt;/a&gt; picks them up. Freshness is hours to daily, and a changed row means a full reload or a merge you write yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium and Kafka, read with &lt;a href="https://docs.databricks.com/gcp/en/connect/streaming/kafka" rel="noopener noreferrer"&gt;Structured Streaming&lt;/a&gt;.&lt;/strong&gt; Changes arrive within seconds. You run Kafka, Kafka Connect, the Debezium SQL Server connector and a Databricks job that keeps running, and the merge logic is yours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/" rel="noopener noreferrer"&gt;Lakeflow Connect&lt;/a&gt;.&lt;/strong&gt; Databricks' managed ingestion lists SQL Server among its CDC database connectors, reading through change tracking or CDC (checked Oct 2026). Nothing to host: it runs on Databricks compute and writes tables the pipeline manages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes a fourth route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, drains the change tables on a schedule and commits Apache Iceberg tables straight into Unity Catalog. Databricks treats them as Unity Catalog managed Iceberg tables, and DuckDB and Spark read the same files through the same catalog.&lt;/p&gt;

&lt;p&gt;I ran every step below on SQL Server 2022 Developer in Docker, OLake Go v1.1.0 and a Databricks workspace on Google Cloud. The timings and row counts are from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the SQL Server to Databricks pipeline looks like
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; SQL Server with CDC on the &lt;code&gt;shop&lt;/code&gt; database and on two tables, &lt;code&gt;dbo.customers&lt;/code&gt; and &lt;code&gt;dbo.orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI from Docker Compose. The first sync records the current log sequence number (LSN) and reads each table in parallel chunks. Every later sync reads only the change tables, starting at the saved LSN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; the Iceberg REST (representational state transfer) endpoint of Unity Catalog. Updates land as Iceberg v3 deletion vectors, the only row-level delete format Databricks reads under Unity Catalog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; SQL Server 2016 SP1 or later on Developer, Standard or Enterprise edition, a Databricks workspace with Unity Catalog, an admin who can grant &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt;, Docker, and about 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Turn on CDC in SQL Server
&lt;/h2&gt;

&lt;p&gt;To follow along with the same data, create these two tables in a database called &lt;code&gt;shop&lt;/code&gt;. My run started with 8 customers and 40 orders. The change step later updates two customers by name, Liam Carter and Zara Ali, so include them or edit those lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="kt"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now switch on CDC for the database and both tables, and create the login OLake Go connects with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'customers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;STATE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdc_jobs&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then confirm all three pieces exist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_cdc_enabled&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shop'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- 1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;capture_instance&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;change_tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;-- dbo_customers, dbo_orders&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_help_job&lt;/span&gt; &lt;span class="nd"&gt;@job_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'cdc.shop_capture'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;-- the Agent job exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What matters on a real server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Agent fills the change tables.&lt;/strong&gt; If the SQL Server Agent is stopped, no change rows appear and SQL Server reports no error. On Amazon RDS and Azure SQL Managed Instance it runs by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change rows expire.&lt;/strong&gt; The cleanup job deletes them after three days by default, so a job paused longer than that needs a fresh snapshot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosted SQL Server&lt;/strong&gt; enables CDC with its own procedure: &lt;code&gt;EXEC msdb.dbo.rds_cdc_enable_db 'shop'&lt;/code&gt; on Amazon RDS, &lt;code&gt;EXEC msdb.dbo.gcloudsql_cdc_enable_db 'shop'&lt;/code&gt; on Cloud SQL. The table step is unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Prepare Unity Catalog
&lt;/h2&gt;

&lt;p&gt;Unity Catalog needs four things, once per workspace:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;External data access&lt;/strong&gt; on the metastore: Catalog, the gear icon, &lt;strong&gt;Metastore&lt;/strong&gt;, then &lt;strong&gt;External data access&lt;/strong&gt;. Without it, the endpoint turns away every client that is not Databricks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A catalog with managed storage&lt;/strong&gt;, backed by an external location in your cloud account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt;&lt;/strong&gt; on that catalog for the writing principal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A personal access token&lt;/strong&gt; for that principal, from Settings, &lt;strong&gt;Developer&lt;/strong&gt;, &lt;strong&gt;Access tokens&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="no"&gt;MANAGED&lt;/span&gt; &lt;span class="no"&gt;LOCATION&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;external location URL&amp;gt;/lakehouse'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MODIFY&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Grants on the catalog carry down to every schema OLake Go creates later. &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt; is not part of &lt;code&gt;ALL PRIVILEGES&lt;/code&gt;, and only the catalog owner can grant it (&lt;a href="https://docs.databricks.com/gcp/en/data-governance/unity-catalog/manage-privileges/privileges" rel="noopener noreferrer"&gt;Databricks: Unity Catalog privileges&lt;/a&gt;). My run wrote into a catalog named &lt;code&gt;datazip&lt;/code&gt; with a token that expired after seven days, and the snippets here use &lt;code&gt;lakehouse&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add SQL Server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt;, go to &lt;strong&gt;Sources&lt;/strong&gt; and click &lt;strong&gt;Create Source&lt;/strong&gt;. Pick &lt;strong&gt;MSSQL&lt;/strong&gt;, name the source and keep the OLake Go version on the latest release.&lt;/p&gt;

&lt;p&gt;Leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on. &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; lets OLake Go create a new capture instance after a schema change, and it then needs &lt;code&gt;db_owner&lt;/code&gt;; leave it off to manage capture instances by hand. Under &lt;strong&gt;Connection details&lt;/strong&gt;, my SQL Server ran in another container, so the host was &lt;code&gt;host.docker.internal&lt;/code&gt;, with port &lt;code&gt;1433&lt;/code&gt;, database &lt;code&gt;shop&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt; and SSL off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdyzp5oqf0rku67xvf5xf.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdyzp5oqf0rku67xvf5xf.webp" alt="OLake UI Edit source form for MSSQL with Enable CDC on, host host.docker.internal, port 1433, database shop, user olake and SSL disabled" width="795" height="1045"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. It tests the connection, then checks for CDC on the database, a capture instance per table and a readable capture job. A failed check shows the current value, the recommended one and what to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Unity Catalog destination
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt;, then &lt;strong&gt;Create Destination&lt;/strong&gt;, then &lt;strong&gt;Apache Iceberg&lt;/strong&gt;, and pick &lt;strong&gt;Unity&lt;/strong&gt; as the catalog type with &lt;strong&gt;Personal Access Token&lt;/strong&gt; authentication.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://&amp;lt;workspace-url&amp;gt;/api/2.1/unity-catalog/iceberg-rest&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unity Catalog Name&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;lakehouse&lt;/code&gt; (the catalog from step 2)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token&lt;/td&gt;
&lt;td&gt;the personal access token from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F775w8zxmz8oj1739bf1x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F775w8zxmz8oj1739bf1x.webp" alt="OLake UI destination form for an Apache Iceberg destination with the Unity catalog type and the personal access token fields" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go calls the Unity Catalog endpoint with the token and saves the destination, so external data access left off, a missing &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt; or a mistyped catalog name fails right here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. I named mine &lt;code&gt;sql_server_to_databricks&lt;/code&gt;, picked the source and the destination, and gave it a schedule. The schedule only decides how often the change tables are drained; it never triggers another full copy.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Databricks, plus DuckDB and Apache Spark if they will read the tables. It decides the delete format: with Databricks listed, OLake Go resolves deletion vectors on Iceberg v3 tables, and there is nothing to pick by hand.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, set each to &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; with ingestion mode &lt;strong&gt;Upsert&lt;/strong&gt;, and leave the &lt;strong&gt;Upsert Type&lt;/strong&gt; at the &lt;strong&gt;Deletion Vector&lt;/strong&gt; that OLake Go resolved. Discovery also lists &lt;code&gt;systranschemas&lt;/code&gt;, a table SQL Server added when CDC was enabled; leave it unticked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6v9bqmvgmpx797nf9kn0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6v9bqmvgmpx797nf9kn0.webp" alt="OLake UI Streams Selection page with dbo customers and orders selected, systranschemas unticked, Full Refresh + CDC, Upsert and Deletion Vector on Iceberg format version V3" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, open the job menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;. My first run copied 8 customers and 40 orders, 48 records and 3.05 KB, in &lt;strong&gt;27 seconds&lt;/strong&gt; with container start included.&lt;/p&gt;

&lt;p&gt;The Unity Catalog schema is named after the job, the source database and the schema, so this job produced &lt;code&gt;sql_server_to_databricks_shop_dbo&lt;/code&gt;. The &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page renames it before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in Databricks
&lt;/h2&gt;

&lt;p&gt;There is no external table to define and nothing to refresh. Open the SQL editor on any SQL warehouse; my checks ran on a 2X-Small serverless SQL warehouse.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_databricks_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_databricks_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(amount), 2) AS total
FROM lakehouse.sql_server_to_databricks_shop_dbo.orders
GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OLake Go adds &lt;code&gt;_olake_id&lt;/code&gt;, &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt; and &lt;code&gt;_cdc_timestamp&lt;/code&gt; to each table, plus &lt;code&gt;_cdc_start_lsn&lt;/code&gt; and &lt;code&gt;_cdc_seqval&lt;/code&gt; on SQL Server tables. &lt;code&gt;DESCRIBE EXTENDED&lt;/code&gt; shows the Iceberg provider and the deletion vectors in the table properties.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in SQL Server and sync again
&lt;/h2&gt;

&lt;p&gt;This is the step that separates CDC from a nightly export. Run these 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Give the capture job a few seconds, then click &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 records (855 bytes)&lt;/strong&gt; from the change tables and finished in &lt;strong&gt;20 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq7gg3z2x3f94detquzks.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq7gg3z2x3f94detquzks.webp" alt="OLake UI job history for sql_server_to_databricks with two completed syncs, the first in 27 seconds and the second in 20 seconds" width="798" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt;, one new data file holds 4 rows (the 2 inserts and the new versions of the 2 updated rows), and one deletion vector retires the 2 old versions. &lt;code&gt;orders&lt;/code&gt; has the same shape with 8 rows and 3 deleted positions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3guh7bu6c2a47xnyf2l.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3guh7bu6c2a47xnyf2l.webp" alt="OLake UI sync log with the Iceberg commit reports for orders and customers: addedDataFiles 1, addedDVs 1, addedRecords 8 and 4, addedPositionalDeletes 3 and 2" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Re-run the &lt;code&gt;customers&lt;/code&gt; query in Databricks. Liam Carter is now &lt;code&gt;gold&lt;/code&gt;, Zara Ali lives in Abu Dhabi, and the two new customers, Maya Patel and Lucas Silva, are there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0tb3rmo2c0q8zdjjm673.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0tb3rmo2c0q8zdjjm673.webp" alt="Databricks SQL editor running SELECT on datazip.sql_server_to_databricks_shop_dbo.customers on a 2X-Small SQL warehouse, returning 10 rows with id, name, city and tier" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_op_type&lt;/code&gt; tells you how each row arrived: &lt;code&gt;r&lt;/code&gt; on the 6 rows untouched since the snapshot, &lt;code&gt;c&lt;/code&gt; on the 2 inserts and &lt;code&gt;u&lt;/code&gt; on the 2 updates. The &lt;code&gt;orders&lt;/code&gt; roll-up matched SQL Server to the cent: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB and Spark
&lt;/h2&gt;

&lt;p&gt;Nothing gets exported. Both engines attach Unity Catalog as an Iceberg REST catalog and ask Databricks for short-lived storage credentials, so no cloud keys are configured on their side.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;unity&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;personal access token&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'lakehouse'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;uc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://&amp;lt;workspace-url&amp;gt;/api/2.1/unity-catalog/iceberg-rest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;unity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'vended_credentials'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;uc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_databricks_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spark-sql \
  --packages org.apache.iceberg:iceberg-spark-runtime-4.0_2.13:1.10.0,org.apache.iceberg:iceberg-gcp-bundle:1.10.0 \
  --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
  --conf spark.sql.catalog.uc=org.apache.iceberg.spark.SparkCatalog \
  --conf spark.sql.catalog.uc.type=rest \
  --conf spark.sql.catalog.uc.uri=https://&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;workspace-url&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/api/2.1/unity-catalog/iceberg-rest \
  --conf spark.sql.catalog.uc.warehouse=lakehouse \
  --conf spark.sql.catalog.uc.token=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;personal access token&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  --conf spark.sql.catalog.uc.header.X-Iceberg-Access-Delegation=vended-credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 and Spark 4.0.1 with Iceberg 1.10.0 both returned the same 10 customers and the same &lt;code&gt;orders&lt;/code&gt; roll-up as Databricks. On AWS or Azure, swap &lt;code&gt;iceberg-gcp-bundle&lt;/code&gt; for &lt;code&gt;iceberg-aws-bundle&lt;/code&gt; or &lt;code&gt;iceberg-azure-bundle&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Untick &lt;code&gt;systranschemas&lt;/code&gt;.&lt;/strong&gt; It has no capture instance, and selecting it fails the first sync with &lt;code&gt;CDC is not enabled for stream dbo.systranschemas&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An empty change sync is usually timing.&lt;/strong&gt; The capture job copies log records every few seconds, so a sync right after a write can find nothing; the next one picks the rows up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Money becomes &lt;code&gt;DOUBLE&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;decimal&lt;/code&gt;, &lt;code&gt;numeric&lt;/code&gt;, &lt;code&gt;money&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; arrive as &lt;code&gt;DOUBLE&lt;/code&gt;, so round at query time when you need exact decimal arithmetic. &lt;code&gt;datetime2&lt;/code&gt; has no zone and is read as UTC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema changes need a capture instance.&lt;/strong&gt; A new column is not in the existing capture instance. Create a new one, or turn on &lt;strong&gt;Manage Capture Instance&lt;/strong&gt;, and OLake Go adds the column on the next sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan compaction.&lt;/strong&gt; Each sync adds a small data file, and Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Unity Catalog endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mind the token.&lt;/strong&gt; An expired personal access token fails the next sync at the first catalog call; production jobs suit a service principal with OAuth machine-to-machine credentials.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the SQL Server to Databricks options compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;bcp&lt;/code&gt; export, then Auto Loader&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;full reloads or your own merge&lt;/td&gt;
&lt;td&gt;tables written by a Databricks pipeline&lt;/td&gt;
&lt;td&gt;an export script, a bucket and a Databricks job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka and Structured Streaming&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with your own merge logic&lt;/td&gt;
&lt;td&gt;Kafka topics, then tables from a streaming job&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium and a running Databricks job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lakeflow Connect&lt;/td&gt;
&lt;td&gt;incremental, through change tracking or CDC&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;tables managed by a Databricks ingestion pipeline&lt;/td&gt;
&lt;td&gt;a Lakeflow Connect pipeline on Databricks compute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into Unity Catalog (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;yes, as deletion vectors&lt;/td&gt;
&lt;td&gt;Iceberg tables that Databricks, DuckDB, Spark and Trino read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If Databricks is the only reader and you want managed ingestion billed inside the workspace, Lakeflow Connect is the simpler path. This route earns its keep once a second engine needs the same rows, or when you want ingestion off Databricks compute.&lt;/p&gt;

&lt;p&gt;It is also the wrong tool in two cases. SQL Server Express and Web editions cannot enable CDC, though Full Refresh + Incremental on an &lt;code&gt;updated_at&lt;/code&gt; column still works there. Tables without a primary key replicate inserts only, because updates and deletes cannot be matched to a row.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I do this without OLake UI?
&lt;/h3&gt;

&lt;p&gt;Yes. The same Docker image runs from the command line: a &lt;code&gt;source.json&lt;/code&gt; whose &lt;code&gt;update_method&lt;/code&gt; is &lt;code&gt;CDC&lt;/code&gt;, a &lt;code&gt;destination.json&lt;/code&gt; with &lt;code&gt;catalog_type&lt;/code&gt; set to &lt;code&gt;unity&lt;/code&gt;, then &lt;code&gt;discover&lt;/code&gt; and &lt;code&gt;sync&lt;/code&gt;. Later runs add &lt;code&gt;--state&lt;/code&gt; so only changes are replayed, and the container needs a persistent &lt;code&gt;OLAKE_INDEX_DB_DIR&lt;/code&gt; for deletion vectors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does writing the tables use a Databricks warehouse?
&lt;/h3&gt;

&lt;p&gt;No. OLake Go writes the Parquet files and deletion vectors from wherever Docker runs, without a Databricks warehouse or cluster. You spend Databricks compute only when you query.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I tell inserts from updates in Databricks?
&lt;/h3&gt;

&lt;p&gt;Filter on &lt;code&gt;_op_type&lt;/code&gt;: &lt;code&gt;c&lt;/code&gt; for inserts, &lt;code&gt;u&lt;/code&gt; for updates and &lt;code&gt;d&lt;/code&gt; for deletes, with &lt;code&gt;r&lt;/code&gt; for rows from the first snapshot. &lt;code&gt;_cdc_timestamp&lt;/code&gt; and &lt;code&gt;_cdc_start_lsn&lt;/code&gt; tell you when and where in the log each change came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add a table by running &lt;code&gt;sys.sp_cdc_enable_table&lt;/code&gt; for it, then tick it on the job's Streams page.&lt;/li&gt;
&lt;li&gt;Raise CDC retention with &lt;code&gt;sys.sp_cdc_change_job&lt;/code&gt; before a planned pause, and shorten it once the job runs reliably every hour.&lt;/li&gt;
&lt;li&gt;The guide with the data type table, the CLI tabs and the troubleshooting list is the &lt;a href="https://olake.io/docs/integrations/sql-server-to-databricks/" rel="noopener noreferrer"&gt;SQL Server to Databricks page on olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your server, leave a comment with what you saw and I will update the post.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>databricks</category>
    </item>
    <item>
      <title>SQL Server to BigQuery: Build a CDC Pipeline That Lands in Your Own Bucket</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Fri, 27 Nov 2026 19:09:17 +0000</pubDate>
      <link>https://dev.to/shubham_olake/sql-server-to-bigquery-build-a-cdc-pipeline-that-lands-in-your-own-bucket-cdi</link>
      <guid>https://dev.to/shubham_olake/sql-server-to-bigquery-build-a-cdc-pipeline-that-lands-in-your-own-bucket-cdi</guid>
      <description>&lt;p&gt;A SQL Server to BigQuery job often begins life as a nightly &lt;code&gt;bcp&lt;/code&gt; export, a CSV file in a bucket and a &lt;code&gt;bq load&lt;/code&gt;. That is enough for a dashboard refreshed once a day. It stops being enough when an order ships at noon, a customer moves city, and the afternoon report still shows the morning's values.&lt;/p&gt;

&lt;p&gt;SQL Server already records those changes. With change data capture (CDC) on, the SQL Server Agent copies each insert, update and delete from the transaction log into a change table. What is left to decide is who reads those tables and where the rows land.&lt;/p&gt;

&lt;p&gt;The usual options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/datastream/docs/sources-sqlserver" rel="noopener noreferrer"&gt;Datastream for SQL Server&lt;/a&gt;:&lt;/strong&gt; Google's managed CDC service, near real time by Google's description. Nothing to run, and the rows land in native BigQuery datasets that only BigQuery reads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and a BigQuery sink connector:&lt;/strong&gt; changes in seconds, but you operate Kafka, Kafka Connect, the Debezium SQL Server connector and the sink.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bcp&lt;/code&gt; to CSV, then &lt;code&gt;bq load&lt;/code&gt;:&lt;/strong&gt; hours to daily, and every run is a full reload, so a deleted row lingers until the next one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes a fourth route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, drains the change tables on a schedule and commits Apache Iceberg tables into BigLake, Google Cloud's Iceberg representational state transfer (REST) catalog. The Parquet files sit in a Cloud Storage bucket you own, BigQuery queries them by a four-part name, and DuckDB and Spark open the same files.&lt;/p&gt;

&lt;p&gt;I ran each step below on 2026-10-30 with SQL Server 2022 Developer in Docker, OLake Go v1.1.0 in OLake UI and a bucket in &lt;code&gt;us-central1&lt;/code&gt;. Every count and timing in this post comes from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the SQL Server to BigQuery pipeline is made of
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; a &lt;code&gt;shop&lt;/code&gt; database with &lt;code&gt;dbo.customers&lt;/code&gt; and &lt;code&gt;dbo.orders&lt;/code&gt;, both with CDC on, starting at 8 customers and 40 orders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake Go in Docker Compose. The first sync records the current log sequence number (LSN) and copies each table; later syncs read the change tables from that LSN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; a BigLake catalog named after the bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Docker, SQL Server 2016 SP1 or later on Developer, Standard or Enterprise edition with the Agent running, and a Google Cloud project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Turn on CDC in SQL Server
&lt;/h2&gt;

&lt;p&gt;Bring your own tables, or create the two the run used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="kt"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, switch CDC on for the database and for each table, and create a login for OLake Go. The &lt;code&gt;msdb&lt;/code&gt; grant at the bottom is the line people forget, and the source test refuses to pass without it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'customers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;STATE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- OLake Go reads the capture job definition in msdb before each sync&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdc_jobs&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm it took:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_cdc_enabled&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shop'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- 1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;capture_instance&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;change_tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;-- dbo_customers, dbo_orders&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_help_job&lt;/span&gt; &lt;span class="nd"&gt;@job_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'cdc.shop_capture'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;-- the Agent job exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things to know on a real server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Agent is what fills the change tables.&lt;/strong&gt; If it is stopped, nothing lands in &lt;code&gt;cdc.*&lt;/code&gt; and SQL Server reports no error. &lt;code&gt;EXEC master.dbo.xp_servicecontrol 'QueryState', 'SQLServerAgent'&lt;/code&gt; answers &lt;code&gt;Running.&lt;/code&gt; when it is up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On Cloud SQL&lt;/strong&gt; the database step is &lt;code&gt;EXEC msdb.dbo.gcloudsql_cdc_enable_db 'shop'&lt;/code&gt; instead. The table step stays the same.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Create the bucket and service account in Google Cloud
&lt;/h2&gt;

&lt;p&gt;Everything here happens in the Google Cloud console, inside the project that will hold the tables.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;APIs and services&lt;/strong&gt;, then &lt;strong&gt;Enable APIs and services&lt;/strong&gt;, and enable the &lt;strong&gt;BigLake API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Cloud Storage&lt;/strong&gt;, create a bucket in the region BigQuery will query from (&lt;code&gt;us-central1&lt;/code&gt; for me). The bucket name turns into the catalog name in SQL, so keep it short.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;IAM and Admin&lt;/strong&gt; (Identity and Access Management), &lt;strong&gt;Service Accounts&lt;/strong&gt;, create one, for example &lt;code&gt;olake-biglake&lt;/code&gt;. Grant it &lt;strong&gt;BigLake Editor&lt;/strong&gt; on the project and &lt;strong&gt;Storage Object User&lt;/strong&gt; on the bucket.&lt;/li&gt;
&lt;li&gt;On the account's &lt;strong&gt;Keys&lt;/strong&gt; tab, pick &lt;strong&gt;Add key&lt;/strong&gt;, &lt;strong&gt;Create new key&lt;/strong&gt;, &lt;strong&gt;JSON&lt;/strong&gt;. The key file downloads only once.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xhi50xozvs9fp70mwxw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xhi50xozvs9fp70mwxw.webp" alt="Google Cloud console Create private key dialog for the OLake service account with the JSON key type selected" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You do not create a catalog. BigLake makes one named after the bucket the first time OLake Go calls it, in end-user credential mode, and that is the mode to keep.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add SQL Server as a source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in as &lt;code&gt;admin&lt;/code&gt; with the password &lt;code&gt;password&lt;/code&gt;. Under &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt;, pick &lt;strong&gt;MSSQL&lt;/strong&gt; and keep the OLake Go version on the latest release.&lt;/p&gt;

&lt;p&gt;Leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on. &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; lets OLake Go create a new capture instance on its own after a schema change, but it needs &lt;code&gt;db_owner&lt;/code&gt;, so leave it off for a read-only login. My connection: host &lt;code&gt;host.docker.internal&lt;/code&gt; (SQL Server ran in another container), port &lt;code&gt;1433&lt;/code&gt;, database &lt;code&gt;shop&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt;, SSL disabled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhfy87v8msgkzotzownbg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhfy87v8msgkzotzownbg.webp" alt="OLake UI Edit source form for MSSQL on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal, port 1433, database shop, user olake and SSL disabled" width="795" height="1045"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. OLake Go tests the login, CDC on the database, a capture instance per table and a readable capture job before it saves anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Point the Iceberg destination at BigLake
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;, pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt; and choose &lt;strong&gt;BigLake&lt;/strong&gt; as the catalog type:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://biglake.googleapis.com/iceberg/v1/restcatalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BigLake Catalog Path&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;gs://&amp;lt;bucket&amp;gt;&lt;/code&gt;, the bucket root with no folder after it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication Type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GCP&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Service Account JSON&lt;/td&gt;
&lt;td&gt;the whole key file from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catalog Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;olake_iceberg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Auth Scopes&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;https://www.googleapis.com/auth/cloud-platform&lt;/code&gt;, the default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Project ID&lt;/td&gt;
&lt;td&gt;your project ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enable Arrow Writes&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwt5i3ea0huvsp7a023z.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwt5i3ea0huvsp7a023z.webp" alt="OLake UI Edit destination form for Apache Iceberg with catalog type Big Lake, the BigLake REST catalog URI, a gs bucket as catalog path, GCP authentication and the project ID" width="790" height="1050"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go calls the endpoint, creates the catalog on first contact, then writes and drops a test table in the bucket. A &lt;code&gt;403&lt;/code&gt; from &lt;code&gt;biglake.googleapis.com&lt;/code&gt; points at a missing BigLake Editor grant, and one from &lt;code&gt;storage.googleapis.com&lt;/code&gt; points at Storage Object User.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Jobs&lt;/strong&gt;, click &lt;strong&gt;Create Job&lt;/strong&gt;. I named mine &lt;code&gt;sql_server_to_bigquery&lt;/code&gt;, gave it a schedule and picked the new source and destination.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Google BigQuery, Apache Spark and DuckDB. OLake Go then only offers delete formats all three read, and in my run it resolved &lt;strong&gt;Positional Deletes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, keep &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and &lt;strong&gt;Upsert&lt;/strong&gt;, and leave &lt;code&gt;systranschemas&lt;/code&gt; unticked (see the tips).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F45alfx6q30ofomjulhqn.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F45alfx6q30ofomjulhqn.webp" alt="OLake UI Streams Selection page with the dbo schema, customers and orders selected, systranschemas unticked, Full Refresh + CDC, Upsert and Positional Deletes on Iceberg format version V2" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then &lt;strong&gt;Sync Now&lt;/strong&gt; from the job's menu. The first run copied 48 records (3.05 KB) in &lt;strong&gt;36 seconds&lt;/strong&gt;, container start included.&lt;/p&gt;

&lt;p&gt;The namespace joins the job name, the source database and the schema, so it came out as &lt;code&gt;sql_server_to_bigquery_shop_dbo&lt;/code&gt;. To use another name, edit the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in BigQuery
&lt;/h2&gt;

&lt;p&gt;There is nothing to register: the bucket is the catalog and the namespace is the dataset. Open the SQL editor, set the query location to the bucket's region, and use the four-part name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.sql_server_to_bigquery_shop_dbo.customers`&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(amount), 2) AS total
FROM `&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.sql_server_to_bigquery_shop_dbo.orders`
GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The account running the queries needs the BigQuery Job User role plus read access to the catalog. OLake Go adds its own columns to each table, among them &lt;code&gt;_op_type&lt;/code&gt;, which is &lt;code&gt;r&lt;/code&gt; on every row straight after the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in SQL Server and sync again
&lt;/h2&gt;

&lt;p&gt;The run then made 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read 12 records (855 bytes) from the change tables and finished in &lt;strong&gt;33 seconds&lt;/strong&gt; end to end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkplkp6lez2p48w1fns2e.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkplkp6lez2p48w1fns2e.webp" alt="OLake UI Job Logs and History for sql_server_to_bigquery showing two completed syncs, the first in 36 seconds and the second in 33 seconds" width="800" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The commit per table was small. &lt;code&gt;customers&lt;/code&gt; received one data file with 4 rows (the 2 inserts and the new versions of the 2 updated rows) and one positional delete file that retires the 2 old versions. &lt;code&gt;orders&lt;/code&gt; followed the same shape with 8 rows and 3 deletes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvbnz7ts8mclpehu1bqjd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvbnz7ts8mclpehu1bqjd.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for customers and orders, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4 and 8, and addedPositionalDeletes 2 and 3" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the customers query again, with no refresh and no &lt;code&gt;ALTER TABLE&lt;/code&gt;. BigQuery returns 10 rows, one per key: Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali is in Abu Dhabi, and Maya Patel and Lucas Silva are new. &lt;code&gt;_op_type&lt;/code&gt; reads &lt;code&gt;r&lt;/code&gt; on the 6 untouched rows, &lt;code&gt;c&lt;/code&gt; on the 2 inserts and &lt;code&gt;u&lt;/code&gt; on the 2 updates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwxgzkgnt6mv2wprkgh5f.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwxgzkgnt6mv2wprkgh5f.webp" alt="BigQuery SQL editor in the Google Cloud console running the customers query on the sql_server_to_bigquery_shop_dbo dataset and returning 10 rows with id, name, city and tier" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The orders query agreed with SQL Server to the cent. It returned 16 delivered orders worth 8659.68, 18 placed worth 10522.26 and 11 shipped worth 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB
&lt;/h2&gt;

&lt;p&gt;DuckDB attaches the same catalog with a Google access token. For the files it needs a hash-based message authentication code (HMAC) key for the same service account, from Cloud Storage, &lt;strong&gt;Settings&lt;/strong&gt;, &lt;strong&gt;Interoperability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl8ooqhcbaz1nbokis6wv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl8ooqhcbaz1nbokis6wv.webp" alt="Google Cloud console Cloud Storage Interoperability settings with the Select a service account dialog, the OLake service account selected and the Create key button" width="800" height="348"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- gcloud auth print-access-token, or a token minted for the service account&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access token&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;EXTRA_HTTP_HEADERS&lt;/span&gt; &lt;span class="no"&gt;MAP&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'x-goog-user-project'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;project-id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_files&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;gcs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac access id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'gs://&amp;lt;bucket&amp;gt;'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://biglake.googleapis.com/iceberg/v1/restcatalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_bigquery_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 gave back the same 10 customers and the same orders totals, and so did Spark 4.0.1 with Iceberg 1.10.0. The access token lasts an hour, so when a query fails with &lt;code&gt;401&lt;/code&gt;, run &lt;code&gt;CREATE OR REPLACE SECRET&lt;/code&gt; with a new one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Untick &lt;code&gt;systranschemas&lt;/code&gt;.&lt;/strong&gt; Enabling CDC adds it to the database with no capture instance, so selecting it stops the first sync with &lt;code&gt;CDC is not enabled for stream dbo.systranschemas&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A sync right after a write can come back empty.&lt;/strong&gt; The capture job fills the change tables every few seconds, so the next sync picks the rows up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new column needs a new capture instance.&lt;/strong&gt; Create one, or turn on Manage Capture Instance, and OLake Go adds the column on the next sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decimals become doubles.&lt;/strong&gt; &lt;code&gt;decimal&lt;/code&gt;, &lt;code&gt;numeric&lt;/code&gt; and &lt;code&gt;money&lt;/code&gt; land as &lt;code&gt;FLOAT64&lt;/code&gt;; round at query time for exact arithmetic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch the metadata file.&lt;/strong&gt; BigLake rejects a &lt;code&gt;metadata.json&lt;/code&gt; above 1 MB, which a busy CDC table reaches after a few thousand syncs, so expire snapshots on a schedule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change rows are kept for three days.&lt;/strong&gt; A job paused longer needs a fresh snapshot.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SQL Server to BigQuery options side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Datastream for SQL Server&lt;/td&gt;
&lt;td&gt;near real time, by Google's description&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native BigQuery datasets, read only by BigQuery&lt;/td&gt;
&lt;td&gt;a connection profile and a stream&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, BigQuery sink&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, through the sink's upsert settings&lt;/td&gt;
&lt;td&gt;Kafka topics, then BigQuery tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium and a sink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;bcp&lt;/code&gt; to CSV, then &lt;code&gt;bq load&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads&lt;/td&gt;
&lt;td&gt;native BigQuery tables&lt;/td&gt;
&lt;td&gt;a script, a scheduler and a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into BigLake (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule, down to one minute&lt;/td&gt;
&lt;td&gt;yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables in your bucket that BigQuery, Spark, DuckDB, Trino and Flink read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When native BigQuery tables are the whole goal, Datastream is the shorter path. The catalog route pays off once Spark, DuckDB or a notebook wants the same rows. Its limit is speed: every query reads Parquet from the bucket, so load the hot slice into a native table when a dashboard needs native speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does this work on SQL Server Express?
&lt;/h3&gt;

&lt;p&gt;No. Express and Web editions cannot turn on change data capture, so there are no change tables for OLake Go to read. Those editions can still run Full Refresh, or Full Refresh + Incremental on an &lt;code&gt;updated_at&lt;/code&gt; column.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which region should the bucket live in?
&lt;/h3&gt;

&lt;p&gt;In the region where BigQuery will run the queries, since a query over the catalog runs in the bucket's region. A query left on the default &lt;code&gt;US&lt;/code&gt; multi-region fails with a "not found" message for a regional bucket.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do deletes in SQL Server show up in BigQuery?
&lt;/h3&gt;

&lt;p&gt;Yes. Later syncs replay deletes from the change tables too, written as Iceberg row-level deletes, and &lt;code&gt;_op_type&lt;/code&gt; marks such a row &lt;code&gt;d&lt;/code&gt;. My run only made inserts and updates, so the results above show &lt;code&gt;c&lt;/code&gt; and &lt;code&gt;u&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does OLake Go use BigQuery compute to write the tables?
&lt;/h3&gt;

&lt;p&gt;No. OLake Go runs wherever Docker runs and writes Parquet files to the bucket with the service account's credentials. BigQuery bills only the queries you run, by bytes scanned on demand or by slot time on an edition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own database. On Cloud SQL for SQL Server only the database-level CDC procedure changes.&lt;/li&gt;
&lt;li&gt;Add a table by running &lt;code&gt;sys.sp_cdc_enable_table&lt;/code&gt; for it, then ticking it on the job's Streams page.&lt;/li&gt;
&lt;li&gt;The full guide, with the CLI tabs, the Spark connection and the complete data type table, is on &lt;a href="https://olake.io/docs/integrations/sql-server-to-bigquery/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your setup, say so in the comments and I'll update the post.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>bigquery</category>
    </item>
    <item>
      <title>SQL Server to Snowflake: A CDC Walkthrough From Change Tables to Snowsight</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Thu, 26 Nov 2026 19:09:28 +0000</pubDate>
      <link>https://dev.to/shubham_olake/sql-server-to-snowflake-a-cdc-walkthrough-from-change-tables-to-snowsight-3ig1</link>
      <guid>https://dev.to/shubham_olake/sql-server-to-snowflake-a-cdc-walkthrough-from-change-tables-to-snowsight-3ig1</guid>
      <description>&lt;p&gt;SQL Server to Snowflake should be an easy change data capture (CDC) story, because SQL Server already does the hard part. Turn CDC on and the SQL Server Agent copies every insert, update and delete from the transaction log into change tables. Yet plenty of pipelines ignore those tables and re-export whole tables every night, or add Kafka just to read them.&lt;/p&gt;

&lt;p&gt;The common ways to move SQL Server data into Snowflake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manual export:&lt;/strong&gt; the &lt;code&gt;bcp&lt;/code&gt; bulk copy utility or SQL Server Integration Services (SSIS) writes files, then &lt;code&gt;COPY INTO&lt;/code&gt; loads them. Hours to daily, and full reloads only, so updates and deletes never arrive as changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and the Snowflake Kafka connector:&lt;/strong&gt; changes reach Snowflake within seconds, but you operate Kafka, Kafka Connect, Debezium and a schema registry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT):&lt;/strong&gt; Fivetran, Estuary or Airbyte Cloud. Nothing to host, but pricing is per row, per GB or per connector, and the rows land as a second copy inside Snowflake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/connectors/sql-server/about" rel="noopener noreferrer"&gt;Snowflake Openflow connector for SQL Server&lt;/a&gt;:&lt;/strong&gt; Snowflake's own connector, writing native tables billed in Snowflake credits. A sound pick when Snowflake is the only reader.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The route in this tutorial skips all four. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt; is an open source (Apache 2.0) tool that drains the change tables on a schedule and writes Apache Iceberg tables straight into Horizon, the catalog that ships with every Snowflake account. The tables show up in Snowsight as Snowflake-managed tables, and DuckDB or Spark can open the very same files.&lt;/p&gt;

&lt;p&gt;I ran every step below on 2026-10-30: SQL Server 2022 Developer in Docker, OLake Go v1.1.0 through OLake UI, and a Snowflake account on AWS ap-south-1 with an X-Small warehouse. Each timing and row count in this post comes from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the SQL Server to Snowflake pipeline looks like
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; a database called &lt;code&gt;shop&lt;/code&gt; with two CDC-enabled tables, &lt;code&gt;dbo.customers&lt;/code&gt; and &lt;code&gt;dbo.orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI and OLake Go in Docker Compose. The first sync notes the current log sequence number (LSN) and copies each table in parallel chunks; later syncs read the change tables from that LSN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; a Snowflake database on Snowflake's own catalog and storage, with no bucket or stage of yours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Docker, a Snowflake account where you can run setup as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;, a SQL Server edition with CDC (Developer, Standard 2016 SP1 or later, or Enterprise), and about 30 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Turn on CDC in SQL Server
&lt;/h2&gt;

&lt;p&gt;No SQL Server handy? Start one in Docker. The capture job is an Agent job, and a container keeps the Agent off unless you ask for it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d --name mssql \
  -e &lt;span class="nv"&gt;ACCEPT_EULA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Y \
  -e &lt;span class="nv"&gt;MSSQL_SA_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;a strong password&amp;gt;'&lt;/span&gt; \
  -e &lt;span class="nv"&gt;MSSQL_AGENT_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; \
  -p 1433:1433 \
  mcr.microsoft.com/mssql/server:2022-latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a database named &lt;code&gt;shop&lt;/code&gt; with these two tables, then insert some rows. The run used 8 customers and 40 orders, but any data works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="kt"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="no"&gt;DATETIME2&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now enable CDC on the database and on each table, and give OLake Go a read-only login:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'customers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_cdc_enable_table&lt;/span&gt; &lt;span class="nd"&gt;@source_schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'dbo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nd"&gt;@source_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="nd"&gt;@role_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;STATE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- OLake Go reads the capture job definition before each sync&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdc_jobs&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;olake&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check it before moving on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_cdc_enabled&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'shop'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- 1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;capture_instance&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;change_tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                        &lt;span class="c1"&gt;-- dbo_customers, dbo_orders&lt;/span&gt;
&lt;span class="no"&gt;EXEC&lt;/span&gt; &lt;span class="n"&gt;msdb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sp_help_job&lt;/span&gt; &lt;span class="nd"&gt;@job_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'cdc.shop_capture'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;-- the Agent job exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Things that matter on a real server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Agent has to run.&lt;/strong&gt; Without it the change tables stay empty, and SQL Server raises no error. &lt;code&gt;EXEC master.dbo.xp_servicecontrol 'QueryState', 'SQLServerAgent'&lt;/code&gt; returns &lt;code&gt;Running.&lt;/code&gt; when it is up; on a virtual machine (VM), start the &lt;code&gt;SQLSERVERAGENT&lt;/code&gt; service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change rows live three days by default.&lt;/strong&gt; A job paused longer than that needs a fresh snapshot, so raise retention with &lt;code&gt;sys.sp_cdc_change_job&lt;/code&gt; before a planned pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosted SQL Server&lt;/strong&gt; swaps the database step for &lt;code&gt;msdb.dbo.rds_cdc_enable_db&lt;/code&gt; on Amazon Relational Database Service (RDS) or &lt;code&gt;msdb.dbo.gcloudsql_cdc_enable_db&lt;/code&gt; on Cloud SQL. The table step and the login are unchanged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary keys.&lt;/strong&gt; Without one, inserts replicate but updates and deletes are not applied.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Prepare Snowflake
&lt;/h2&gt;

&lt;p&gt;Open a Snowsight worksheet and run this once as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;. It creates the database, a role OLake Go writes as, a service user, the network policy and a programmatic access token (PAT):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;ACCOUNTADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;XSMALL&lt;/span&gt; &lt;span class="no"&gt;AUTO_SUSPEND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="no"&gt;AUTO_RESUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL_VOLUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE_MANAGED'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;SYSADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SERVICE&lt;/span&gt; &lt;span class="no"&gt;DEFAULT_ROLE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUBLIC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;RULE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_ip&lt;/span&gt;
  &lt;span class="no"&gt;MODE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;INGRESS&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;IPV4&lt;/span&gt; &lt;span class="no"&gt;VALUE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;OLake Go egress IP&amp;gt;/32'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;
  &lt;span class="no"&gt;ALLOWED_NETWORK_RULE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'OLAKE_DEMO.PUBLIC.olake_ip'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;NETWORK_POLICY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ORGANIZATION_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'-'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ACCOUNT_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;account_identifier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="no"&gt;CURRENT_REGION&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="no"&gt;PROGRAMMATIC&lt;/span&gt; &lt;span class="no"&gt;ACCESS&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="no"&gt;OLAKE_PAT&lt;/span&gt;
  &lt;span class="no"&gt;ROLE_RESTRICTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_ROLE'&lt;/span&gt; &lt;span class="no"&gt;DAYS_TO_EXPIRY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two &lt;code&gt;ALTER DATABASE&lt;/code&gt; lines make every table OLake Go creates a Snowflake-managed Iceberg table on Snowflake's storage, so there is no &lt;code&gt;CREATE ICEBERG TABLE&lt;/code&gt; or external volume later.&lt;/p&gt;

&lt;p&gt;Note the &lt;code&gt;account_identifier&lt;/code&gt;, the &lt;code&gt;region&lt;/code&gt; and the token, which Snowflake displays only once. &lt;code&gt;curl -s https://checkip.amazonaws.com&lt;/code&gt; prints your public IP for the network rule.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Skip the network policy and the token statement fails with &lt;code&gt;Network Policy is required when creating a programmatic access token for user OLAKE_SVC&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add SQL Server as a source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and log in with the default &lt;code&gt;admin&lt;/code&gt; account. Go to &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and pick &lt;strong&gt;MSSQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on and &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; off (see the tips on schema changes). My connection details: host &lt;code&gt;host.docker.internal&lt;/code&gt; (SQL Server ran in another container), port &lt;code&gt;1433&lt;/code&gt;, database &lt;code&gt;shop&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt; and SSL mode &lt;code&gt;disable&lt;/code&gt;. Click &lt;strong&gt;Set up source&lt;/strong&gt;, and OLake Go tests the login, then checks CDC on the database, a capture instance per table and a readable capture job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff5lvayhximxmo3meevj9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff5lvayhximxmo3meevj9.webp" alt="OLake UI source form for MSSQL on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal, port 1433, database shop and user olake" width="795" height="1045"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Point the destination at Horizon
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;, pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt;, then catalog type &lt;strong&gt;Horizon&lt;/strong&gt; and authentication &lt;strong&gt;Programmatic Access Token (PAT)&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Horizon Iceberg REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake Database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;OLAKE_DEMO&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session Role Scope&lt;/td&gt;
&lt;td&gt;&lt;code&gt;session:role:OLAKE_ROLE&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Programmatic Access Token&lt;/td&gt;
&lt;td&gt;the token from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud Storage Region&lt;/td&gt;
&lt;td&gt;the region from step 2, &lt;code&gt;AWS_AP_SOUTH_1&lt;/code&gt; in my run&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" alt="OLake UI destination form for the Snowflake Horizon catalog with the programmatic access token authentication fields" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go exchanges the token with Horizon before saving, so a blocked IP or a wrong scope fails here instead of in the middle of a sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. I named mine &lt;code&gt;sql_server_to_snowflake&lt;/code&gt; and picked the new source and destination.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Snowflake, plus DuckDB and Apache Spark if they will read the tables. That list is the only format decision you make: OLake Go works out an Iceberg delete format every listed engine reads and sets it on each stream.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, keep &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and &lt;strong&gt;Upsert&lt;/strong&gt;, and leave the upsert type as resolved (Positional Deletes in my run).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhwozbdg5p2h7y8uex5wr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhwozbdg5p2h7y8uex5wr.webp" alt="OLake UI Streams Selection with dbo customers and orders ticked, systranschemas unticked, Full Refresh + CDC, Upsert and Positional Deletes" width="799" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then &lt;strong&gt;Sync Now&lt;/strong&gt; from the job's menu. The first run copied 48 records (3.05 KB) in &lt;strong&gt;37 seconds&lt;/strong&gt;, container start included.&lt;/p&gt;

&lt;p&gt;The schema name joins the job, the source database and the schema: &lt;code&gt;sql_server_to_snowflake_shop_dbo&lt;/code&gt;. The &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page renames it before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the tables in Snowflake
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;ICEBERG&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"sql_server_to_snowflake_shop_dbo"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"city"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"_op_type"&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"sql_server_to_snowflake_shop_dbo"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"customers"&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is no registration step and nothing to refresh. &lt;code&gt;SHOW ICEBERG TABLES&lt;/code&gt; lists both tables with &lt;code&gt;iceberg_table_type = MANAGED&lt;/code&gt; on &lt;code&gt;SNOWFLAKE_MANAGED&lt;/code&gt; storage.&lt;/p&gt;

&lt;p&gt;Quote every name. OLake Go keeps the lowercase SQL Server names, and Snowflake upper-cases an unquoted identifier into one that does not exist.&lt;/p&gt;

&lt;p&gt;Each table also carries OLake Go's own columns: &lt;code&gt;_olake_id&lt;/code&gt;, &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt; and &lt;code&gt;_cdc_timestamp&lt;/code&gt;, plus &lt;code&gt;_cdc_start_lsn&lt;/code&gt; and &lt;code&gt;_cdc_seqval&lt;/code&gt;, the log position each SQL Server change came from. Right after the first sync every &lt;code&gt;_op_type&lt;/code&gt; is &lt;code&gt;r&lt;/code&gt;, a snapshot row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change rows in SQL Server and sync again
&lt;/h2&gt;

&lt;p&gt;After the first sync, the run made 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1299.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;349.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;89.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;79.90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;    &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SYSUTCDATETIME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hit &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync pulled 12 records (855 bytes) from the change tables and finished in &lt;strong&gt;18 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcu0n357x70icfampzbqg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcu0n357x70icfampzbqg.webp" alt="OLake UI Job Logs and History for sql_server_to_snowflake: first sync 37 seconds, second sync 18 seconds, both Completed" width="800" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt;, that sync wrote one data file holding 4 rows: the 2 inserts and the new versions of the 2 updated rows. A single positional delete file retired the 2 old versions, and &lt;code&gt;orders&lt;/code&gt; followed the same pattern with 8 rows and 3 deletes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2cz0kkzsccrkfveyb7m4.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2cz0kkzsccrkfveyb7m4.webp" alt="OLake UI sync log filtered to the Iceberg commit report, with addedDataFiles 1, addedPositionalDeleteFiles 1 and addedPositionalDeletes for customers and orders" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Re-run the &lt;code&gt;SELECT&lt;/code&gt; in Snowsight with no refresh. Liam Carter is now &lt;code&gt;gold&lt;/code&gt;, Zara Ali lives in Abu Dhabi, and the two new customers sit at ids 9 and 10 with &lt;code&gt;_op_type&lt;/code&gt; &lt;code&gt;c&lt;/code&gt;, next to &lt;code&gt;u&lt;/code&gt; on the updated rows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fosnmd0klyhoie0knja4x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fosnmd0klyhoie0knja4x.webp" alt="Snowsight query on sql_server_to_snowflake_shop_dbo.customers returning 10 rows, with r for snapshot rows, u for the two updates and c for the two inserts" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A change made seconds before the sync can be missing. The Agent's capture job copies log records into the change tables every few seconds, so a very fresh write lands one sync later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB
&lt;/h2&gt;

&lt;p&gt;These are Iceberg tables in Snowflake's catalog, so another engine reads the same files without an export. DuckDB wants a short-lived bearer token, so exchange the PAT first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -X POST &lt;span class="s2"&gt;"https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/x-www-form-urlencoded'&lt;/span&gt; \
  --data-urlencode &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials \
  --data-urlencode &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;session:role:OLAKE_ROLE \
  --data-urlencode &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;your PAT&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access_token from /v1/oauth/tokens&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_DEMO'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'vended_credentials'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_server_to_snowflake_shop_dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers, and so did Spark 3.5.6 with Iceberg 1.10.0. An &lt;code&gt;orders&lt;/code&gt; roll-up matched SQL Server to the cent in all three engines: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;p&gt;The session token lasts about an hour. DuckDB only attaches catalogs backed by S3, S3 Tables or Google Cloud Storage, so this path needs a Snowflake account hosted on AWS or Google Cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Untick &lt;code&gt;systranschemas&lt;/code&gt;.&lt;/strong&gt; Enabling CDC adds &lt;code&gt;dbo.systranschemas&lt;/code&gt; to the database, discovery lists it, and it has no capture instance. Select it and the first sync stops with &lt;code&gt;CDC is not enabled for stream dbo.systranschemas&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new column needs a new capture instance.&lt;/strong&gt; Create one by hand, or turn on &lt;strong&gt;Manage Capture Instance&lt;/strong&gt; (it needs &lt;code&gt;db_owner&lt;/code&gt;), and OLake Go adds the column on the next sync. Narrowing type changes fail the sync instead of corrupting the table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decimals arrive as &lt;code&gt;FLOAT&lt;/code&gt;.&lt;/strong&gt; The sums above still matched to the cent, but round at query time for exact decimal arithmetic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;datetime2&lt;/code&gt; is read as UTC&lt;/strong&gt; and shows up as &lt;code&gt;TIMESTAMP_LTZ(6)&lt;/code&gt;. Set the session time zone before comparing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotate the token.&lt;/strong&gt; It lasts 30 days in the setup above and 365 at most. An expired token fails the next sync at the catalog handshake, before any data moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for compaction.&lt;/strong&gt; Snowflake expires snapshots and compacts manifests on these tables at no cost, but data-file compaction is bundled only when Snowflake alone writes the table. Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Horizon endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the SQL Server to Snowflake options compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;bcp&lt;/code&gt; or SSIS, then &lt;code&gt;COPY INTO&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads&lt;/td&gt;
&lt;td&gt;files, then Snowflake tables&lt;/td&gt;
&lt;td&gt;a script and a scheduler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, Snowflake Kafka connector&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with tombstone handling&lt;/td&gt;
&lt;td&gt;Kafka topics, then Snowflake tables&lt;/td&gt;
&lt;td&gt;Kafka, Connect, Debezium, schema registry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;a second copy in Snowflake&lt;/td&gt;
&lt;td&gt;nothing; per row, per GB or per connector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake Openflow&lt;/td&gt;
&lt;td&gt;change tracking or CDC&lt;/td&gt;
&lt;td&gt;yes, as soft deletes&lt;/td&gt;
&lt;td&gt;native Snowflake tables&lt;/td&gt;
&lt;td&gt;an Openflow deployment, billed in credits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into Horizon (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule, down to one minute&lt;/td&gt;
&lt;td&gt;yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables that Snowflake, DuckDB, Spark and Trino read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If Snowflake will stay the only reader and you would rather Snowflake ran the pipeline, Openflow is the shorter path. Writing Iceberg once pays off as soon as a second engine needs the rows, or when you want to own the files.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Which SQL Server editions can I use for this?
&lt;/h3&gt;

&lt;p&gt;Developer, Standard from 2016 SP1, and Enterprise all have CDC. Express and Web do not, and Azure SQL Database needs the S3 tier or higher. Without CDC, OLake Go can still run Full Refresh or Full Refresh + Incremental on an &lt;code&gt;updated_at&lt;/code&gt; column.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does OLake Go spend Snowflake warehouse credits to write?
&lt;/h3&gt;

&lt;p&gt;No. OLake Go runs wherever Docker runs and writes the files itself, so the warehouse only wakes up for your queries. With &lt;code&gt;SNOWFLAKE_MANAGED&lt;/code&gt; storage the files are billed at Snowflake storage rates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do deletes in SQL Server reach Snowflake too?
&lt;/h3&gt;

&lt;p&gt;Yes. Later syncs replay deletes from the change tables along with inserts and updates, and &lt;code&gt;_op_type&lt;/code&gt; uses &lt;code&gt;d&lt;/code&gt; for a delete. My run only inserted and updated rows, so the screenshots show &lt;code&gt;c&lt;/code&gt; and &lt;code&gt;u&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where do the files live if I would rather keep them in S3?
&lt;/h3&gt;

&lt;p&gt;Use AWS Glue as the catalog instead of Horizon. The files then sit in your bucket, Snowflake reads them through a catalog integration that you refresh after each sync, and Athena, Redshift and Amazon Elastic MapReduce (EMR) read the same tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own database. On RDS or Cloud SQL, only the database-level CDC procedure changes.&lt;/li&gt;
&lt;li&gt;Add a table by running &lt;code&gt;sys.sp_cdc_enable_table&lt;/code&gt; for it, then selecting it in the job's streams.&lt;/li&gt;
&lt;li&gt;The full guide, with the Glue tabs, the Spark connection and the data type table, is on &lt;a href="https://olake.io/docs/integrations/sql-server-to-snowflake/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently for you, say so in the comments and I'll update the post.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>snowflake</category>
    </item>
    <item>
      <title>MongoDB to Redshift Without a Load Job: A Change Stream Tutorial on AWS Glue</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Wed, 25 Nov 2026 20:19:46 +0000</pubDate>
      <link>https://dev.to/shubham_olake/mongodb-to-redshift-without-a-load-job-a-change-stream-tutorial-on-aws-glue-ljg</link>
      <guid>https://dev.to/shubham_olake/mongodb-to-redshift-without-a-load-job-a-change-stream-tutorial-on-aws-glue-ljg</guid>
      <description>&lt;p&gt;Two questions sit inside every MongoDB to Redshift project. What does a document look like once it is a row in a SQL warehouse? And how does an order that was edited an hour after the first copy ever get there?&lt;/p&gt;

&lt;p&gt;A first attempt usually answers neither. A script exports the collection, &lt;code&gt;COPY&lt;/code&gt; loads the file, and the edit shows up tomorrow, provided the whole table is reloaded.&lt;/p&gt;

&lt;p&gt;These are the routes people usually take:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;mongoexport&lt;/code&gt; to JSON, then &lt;code&gt;COPY&lt;/code&gt;.&lt;/strong&gt; You keep a script, a scheduler and a staging bucket. Freshness is hours to daily, and only full reloads are possible, so an update or a delete never arrives as a change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Redshift.html" rel="noopener noreferrer"&gt;AWS Database Migration Service (DMS)&lt;/a&gt; with its &lt;a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html" rel="noopener noreferrer"&gt;MongoDB source&lt;/a&gt;.&lt;/strong&gt; Change data capture (CDC) through the oplog or change streams into native Redshift tables, in document mode or table mode. You run a replication instance and a task, plus a staging bucket in Amazon Simple Storage Service (S3).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and a Redshift sink.&lt;/strong&gt; Changes land within seconds. The cost is Kafka, Kafka Connect, Debezium and one sink connector per collection, plus merge logic that you write.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT) services such as Fivetran, Estuary or Airbyte Cloud.&lt;/strong&gt; Nothing to host, and minutes of lag depending on the plan. They charge per row, per GB or per connector for a second copy inside Redshift.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes another route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, follows the MongoDB change stream and commits each collection as an Apache Iceberg table in the AWS Glue Data Catalog, with the files in a bucket you own. Redshift maps the Glue database onto an external schema and queries the tables where they sit, and Athena and DuckDB read the same files.&lt;/p&gt;

&lt;p&gt;I ran every step on 2026-10-30 against MongoDB 7 as a single-node replica set in Docker, OLake Go v1.1.0 and a Redshift Serverless workgroup at 8 Redshift Processing Units (RPU) in &lt;code&gt;ap-southeast-1&lt;/code&gt;. The first sync took 14 seconds and the change sync 11 seconds. Every figure below is from that run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; MongoDB 4.0 or later as a replica set (self-hosted or Atlas), an AWS account where you can create a bucket and Identity and Access Management (IAM) entities, Redshift Serverless or an RA3 cluster, Docker, and about 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: A replica set, a user and two collections
&lt;/h2&gt;

&lt;p&gt;OLake Go reads changes through a change stream, which MongoDB offers only in replica set mode. One member is enough, and that is what I used. Launch &lt;code&gt;mongod&lt;/code&gt; with &lt;code&gt;--replSet rs0&lt;/code&gt;, connect with &lt;code&gt;mongosh&lt;/code&gt; and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. A single-node replica set (self-hosted only)&lt;/span&gt;
&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rs0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;host&amp;gt;:27017"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 2. A user for OLake Go&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"olake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"shop"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"clusterMonitor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 3. The oplog size in bytes; raise it with replSetResizeOplog if it is small&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oplog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxSize&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;read&lt;/code&gt; lets OLake Go copy the collections. The change stream needs oplog access on top, and &lt;code&gt;clusterMonitor&lt;/code&gt; grants it (&lt;code&gt;readAnyDatabase&lt;/code&gt; does too).&lt;/p&gt;

&lt;p&gt;Confirm the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stateStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// one PRIMARY&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSiblingDB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, some data. The script below rebuilds the two collections from my run: 8 customers and 40 orders, with integer &lt;code&gt;_id&lt;/code&gt; keys and the order amount stored as &lt;code&gt;NumberDecimal&lt;/code&gt;. Skip it if you are pointing at collections you already have.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Aarav Mehta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'aarav'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Priya Sharma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'priya'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Bengaluru'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'liam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Austin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Sofia Rossi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'sofia'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Milan'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Kenji Tanaka'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'kenji'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Tokyo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Emma Schulz'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'emma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Berlin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Noah Kim'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'noah'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Seoul'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'zara'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Dubai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;'@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Headphones'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7919&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;120000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Atlas the replica set already exists. Create the user under &lt;strong&gt;Database Access&lt;/strong&gt; with the same two roles, and allow OLake Go's IP under &lt;strong&gt;Network Access&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The oplog is your replay window. Atlas and most self-hosted installs keep 24 hours or less by default, and a job paused past the window has to take a fresh snapshot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: A bucket, a writer and a reader on AWS
&lt;/h2&gt;

&lt;p&gt;Create an S3 bucket in the region where your Redshift workgroup or cluster runs. Mine was in &lt;code&gt;ap-southeast-1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;OLake Go writes with its own identity. I gave it a scoped IAM user with this inline policy; swap in your bucket, region and account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:GetBucketLocation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;bucket&amp;gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:PutObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:DeleteObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:AbortMultipartUpload"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"s3:ListMultipartUploadParts"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;bucket&amp;gt;/*"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetDatabases"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:CreateDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:GetTables"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:CreateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:UpdateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glue:DeleteTable"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:catalog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:database/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:glue:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:table/*/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Redshift reads with a different identity: an IAM role attached to the Serverless namespace or the cluster. In my run that role carried &lt;code&gt;AmazonS3ReadOnlyAccess&lt;/code&gt; plus read access to Glue.&lt;/p&gt;

&lt;p&gt;Do not create a Glue database. OLake Go makes one per job on the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and connect MongoDB
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and log in as &lt;code&gt;admin&lt;/code&gt; with the password &lt;code&gt;password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and choose &lt;strong&gt;MongoDB&lt;/strong&gt;. Under &lt;strong&gt;Change data capture (CDC)&lt;/strong&gt;, leave &lt;strong&gt;Enable CDC&lt;/strong&gt; switched on.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Connection details&lt;/strong&gt;, enter the host as &lt;code&gt;host:port&lt;/code&gt;, the &lt;strong&gt;Database Name&lt;/strong&gt;, the &lt;strong&gt;Auth DB&lt;/strong&gt;, the username and password, and the &lt;strong&gt;Replica Set&lt;/strong&gt; name. MongoDB sat in a separate container in my run, so I entered &lt;code&gt;host.docker.internal:27017&lt;/code&gt;, &lt;code&gt;shop&lt;/code&gt;, &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;olake&lt;/code&gt; and &lt;code&gt;rs0&lt;/code&gt;. Leave &lt;strong&gt;Read Preference&lt;/strong&gt; on &lt;code&gt;primary&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy3jn83ddxs9o0pqg57mw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy3jn83ddxs9o0pqg57mw.webp" alt="OLake UI source form for MongoDB on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal:27017, database shop, auth DB admin, user olake, replica set rs0 and chunking strategy Split Vector" width="770" height="1531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. Before anything is saved, OLake Go tests the connection, checks that it can open a change stream and reports the oplog window. A window shorter than 7 days is flagged as a warning and does not block you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Glue destination
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt; and click &lt;strong&gt;Create Destination&lt;/strong&gt;. Choose &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector and &lt;strong&gt;AWS Glue&lt;/strong&gt; as the catalog type.&lt;/p&gt;

&lt;p&gt;Three things go in the form: the S3 path OLake Go should write under, the AWS region of the bucket and the Glue catalog, and the access key pair of the writer user from step 2. If OLake Go runs on an instance that has a role, leave the two key fields empty. Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsv8rngjrffpwvthjz81h.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsv8rngjrffpwvthjz81h.webp" alt="OLake UI destination form for Apache Iceberg with catalog type AWS Glue, an S3 path under the lab bucket, region ap-southeast-1 and an access key pair" width="768" height="859"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. Name it &lt;code&gt;mongodb_to_redshift&lt;/code&gt;, give it a schedule (&lt;strong&gt;Every Day&lt;/strong&gt; at a fixed hour, or a cron expression), and select the source and destination you just made. The schedule sets how often the change stream is drained, and the full copy happens only once.&lt;/p&gt;

&lt;p&gt;One setting needs a manual choice. Redshift is not in OLake Go's &lt;strong&gt;Target Query Engines&lt;/strong&gt; list yet, so under &lt;strong&gt;Advanced Settings&lt;/strong&gt; pick &lt;strong&gt;AWS Athena&lt;/strong&gt; and &lt;strong&gt;DuckDB&lt;/strong&gt; instead.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;, and OLake Go discovers the collections and opens the &lt;strong&gt;Streams&lt;/strong&gt; page. Tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, set the sync mode to &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and the ingestion mode to &lt;strong&gt;Upsert&lt;/strong&gt;. Then set &lt;strong&gt;Upsert Type&lt;/strong&gt; to &lt;strong&gt;Positional Deletes&lt;/strong&gt;, because that is the delete format Redshift reads, and Athena and DuckDB read it as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuamroiufvwav9641d4qd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuamroiufvwav9641d4qd.webp" alt="OLake UI Streams Selection page with the shop database, customers and orders ticked, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Positional Deletes on Iceberg format version V2" width="799" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;My first sync copied 8 customers and 40 orders, 48 documents and 6.40 KB in total, in &lt;strong&gt;14 seconds&lt;/strong&gt; with container start included.&lt;/p&gt;

&lt;p&gt;OLake Go named the Glue database &lt;code&gt;mongodb_to_redshift_shop&lt;/code&gt;, after the job and the source database. To use a different name, edit the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: One external schema in Redshift
&lt;/h2&gt;

&lt;p&gt;Open query editor v2. Run the first statement once, after the first sync and in the same region as the Glue database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;DATA&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt;
&lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="s1"&gt;'mongodb_to_redshift_shop'&lt;/span&gt;
&lt;span class="no"&gt;IAM_ROLE&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, sum(cast(amount AS decimal(12,2))) AS total
FROM lakehouse.orders GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;IAM_ROLE default&lt;/code&gt; picks the default role of the namespace or cluster. Name a specific role instead if you keep several.&lt;/p&gt;

&lt;p&gt;The key column is &lt;code&gt;_id&lt;/code&gt;, the same as in MongoDB. The roll-up casts &lt;code&gt;amount&lt;/code&gt; because a &lt;code&gt;Decimal128&lt;/code&gt; field reaches Redshift as text, and a plain &lt;code&gt;sum(amount)&lt;/code&gt; fails with &lt;code&gt;ERROR: function sum(character varying) does not exist&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Edit documents and sync again
&lt;/h2&gt;

&lt;p&gt;Now the part a nightly export cannot do. Make 12 changes in &lt;code&gt;mongosh&lt;/code&gt;, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1299.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'25.50'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'349.99'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'89.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'79.90'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 change events (1.60 KB)&lt;/strong&gt; from the stream and was done in &lt;strong&gt;11 seconds&lt;/strong&gt; end to end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foyswul1j9itpubloqb8u.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foyswul1j9itpubloqb8u.webp" alt="OLake UI Job Logs and History for mongodb_to_redshift with two completed syncs, the first in 14 seconds and the second in 11 seconds" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt;, OLake Go wrote one new data file holding 4 rows: the 2 inserts and the new versions of the 2 updated documents. A small positional delete file retires the 2 old versions. The sync log's commit report shows the same numbers: &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedPositionalDeleteFiles=1&lt;/code&gt;, &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm5ce8pr2w3m3cvdskz0d.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm5ce8pr2w3m3cvdskz0d.webp" alt="OLake UI sync log filtered to the Iceberg commit report for customers, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4, totalRecords 12 and addedPositionalDeletes 2" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; follows the same pattern with 8 rows and 3 deletes.&lt;/p&gt;

&lt;p&gt;Back in Redshift, rerun the customers query. There is no refresh and no &lt;code&gt;ALTER TABLE&lt;/code&gt; to run first. I got 10 rows, one per key: Liam Carter on &lt;code&gt;gold&lt;/code&gt;, Zara Ali in Abu Dhabi, and the two new customers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhdy1y5osop54nj1n1xut.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhdy1y5osop54nj1n1xut.webp" alt="Redshift query editor v2 in the AWS console running the customers query on the Serverless workgroup and returning 10 rows with _id, name, city and tier" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;_op_type&lt;/code&gt; to the select list to see how each row arrived: &lt;code&gt;r&lt;/code&gt; for the snapshot, &lt;code&gt;c&lt;/code&gt; for an insert, &lt;code&gt;u&lt;/code&gt; for an update and &lt;code&gt;d&lt;/code&gt; for a delete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Athena and DuckDB on the same files
&lt;/h2&gt;

&lt;p&gt;Nothing is exported for this. Athena shows &lt;code&gt;mongodb_to_redshift_shop&lt;/code&gt; in its database list, with no registration and no refresh. Pick a workgroup that has a query result location in S3 and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;mongodb_to_redshift_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3581uer08vquep0bjgc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3581uer08vquep0bjgc.webp" alt="Athena query editor in the AWS console running the customers query on the mongodb_to_redshift_shop database and returning 10 rows with _id, name, city and tier" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Athena returned the same 10 customers and scanned 0.76 KB.&lt;/p&gt;

&lt;p&gt;DuckDB reads each table from its current metadata file, and Glue knows where that file is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws glue get-table --database-name mongodb_to_redshift_shop --name customers \
  --query &lt;span class="s1"&gt;'Table.Parameters.metadata_location'&lt;/span&gt; --output text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;lake&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;secret key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;REGION&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;region&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nf"&gt;iceberg_scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;metadata_location from the command above&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each sync writes a new metadata file, so fetch the location again before a fresh read. DuckDB 1.5.5 gave me the same 10 customers.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;orders&lt;/code&gt; roll-up matched MongoDB to the cent in all three engines: 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips and limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;This is not native Redshift speed.&lt;/strong&gt; The external schema goes through Redshift Spectrum, which reads Parquet from S3 on every query. For a hot dashboard, load the hot slice into a native table on a schedule and keep the Iceberg tables as the source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flattening stops at one level.&lt;/strong&gt; Nested objects and arrays land as JSON text in one &lt;code&gt;VARCHAR&lt;/code&gt; column, which you unpack with &lt;code&gt;JSON_PARSE&lt;/code&gt; or &lt;code&gt;json_extract_path_text&lt;/code&gt;. If every query would start that way, a &lt;code&gt;SUPER&lt;/code&gt; column in a native Redshift table may serve you better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two type surprises.&lt;/strong&gt; A &lt;code&gt;date&lt;/code&gt; becomes a &lt;code&gt;TIMESTAMP&lt;/code&gt; in Coordinated Universal Time (UTC), and an &lt;code&gt;ObjectId&lt;/code&gt; key arrives as its 24-character hex string. Store doubles in MongoDB if you want money as a numeric column without the cast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new field becomes a new column&lt;/strong&gt; on the next sync, with nulls for older rows. A field whose type changes in an incompatible way fails the sync instead of corrupting the table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The oplog is sized in gigabytes, not hours.&lt;/strong&gt; A write-heavy day shortens the window, so check it after a busy day and resize before a planned pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness is a schedule,&lt;/strong&gt; down to one minute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The external schema is read-only.&lt;/strong&gt; &lt;code&gt;INSERT&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; on these tables fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  MongoDB to Redshift methods compared
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mongoexport&lt;/code&gt;, then &lt;code&gt;COPY&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads only&lt;/td&gt;
&lt;td&gt;native Redshift tables&lt;/td&gt;
&lt;td&gt;a script, a scheduler, a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS DMS&lt;/td&gt;
&lt;td&gt;CDC through the oplog or change streams&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native Redshift tables, document or table mode&lt;/td&gt;
&lt;td&gt;a replication instance and task, plus a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, Redshift sink&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with your own merge logic&lt;/td&gt;
&lt;td&gt;Kafka topics, then Redshift tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a sink per collection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;varies by tool&lt;/td&gt;
&lt;td&gt;Redshift tables, as a second copy&lt;/td&gt;
&lt;td&gt;nothing; per row, per GB or per connector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go to Glue (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule, down to one minute&lt;/td&gt;
&lt;td&gt;yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables for Redshift, Athena, Spark and DuckDB&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, your bucket and compute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you are already on AWS and Redshift will be the only reader, DMS is the simpler choice. The route above earns its setup when Athena, Spark or a notebook will read those rows too, or when you want to own the files.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I run the pipeline without the UI?
&lt;/h3&gt;

&lt;p&gt;Yes. The same job runs from the &lt;code&gt;olakego/source-mongodb:latest&lt;/code&gt; image with a &lt;code&gt;discover&lt;/code&gt; command and a &lt;code&gt;sync&lt;/code&gt; command. In &lt;code&gt;selected_streams.json&lt;/code&gt;, set &lt;code&gt;sync_mode&lt;/code&gt; to &lt;code&gt;cdc&lt;/code&gt; and &lt;code&gt;update_type&lt;/code&gt; to &lt;code&gt;pos&lt;/code&gt;, and give the container a persistent directory through &lt;code&gt;OLAKE_INDEX_DB_DIR&lt;/code&gt;, because positional deletes keep a small index between runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do I pay Redshift for in this setup?
&lt;/h3&gt;

&lt;p&gt;Redshift Serverless bills RPU-hours only while queries run. Each query on the external schema scans Parquet files in S3, so select only the columns you need. The files are billed at S3 rates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who cleans up the small files each sync leaves behind?
&lt;/h3&gt;

&lt;p&gt;Not Glue, which has no built-in compaction for tables written by external engines. OLake Fusion does it for the catalogs OLake Go writes to, and Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Glue catalog.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own collections. On Atlas, the source form takes one SRV host with &lt;strong&gt;Use SRV&lt;/strong&gt; turned on.&lt;/li&gt;
&lt;li&gt;Give the job a schedule that is shorter than your oplog window.&lt;/li&gt;
&lt;li&gt;The full guide has the command line configuration, the complete data type table and the troubleshooting list: &lt;a href="https://olake.io/docs/integrations/mongodb-to-redshift/" rel="noopener noreferrer"&gt;MongoDB to Redshift on olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your setup, leave the error text in a comment and I will update the tutorial.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>redshift</category>
    </item>
    <item>
      <title>MongoDB to ClickHouse CDC Tutorial: From a Replica Set to One CREATE DATABASE</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Tue, 24 Nov 2026 18:37:41 +0000</pubDate>
      <link>https://dev.to/shubham_olake/mongodb-to-clickhouse-cdc-tutorial-from-a-replica-set-to-one-create-database-28l2</link>
      <guid>https://dev.to/shubham_olake/mongodb-to-clickhouse-cdc-tutorial-from-a-replica-set-to-one-create-database-28l2</guid>
      <description>&lt;p&gt;Analytics on a MongoDB app usually starts inside MongoDB, as an aggregation pipeline that groups orders by status. It works until the collections grow and those aggregations compete with the writes the application depends on. That is when MongoDB to ClickHouse comes up, because ClickHouse is made for the scans MongoDB is not.&lt;/p&gt;

&lt;p&gt;The hard part is keeping the two in step. Documents are rewritten in place, so an exported file never shows an update as a change.&lt;/p&gt;

&lt;p&gt;The common ways to move the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://clickhouse.com/docs/integrations/clickpipes/mongodb" rel="noopener noreferrer"&gt;ClickPipes for MongoDB&lt;/a&gt;.&lt;/strong&gt; Change data capture (CDC) through change streams, run by ClickHouse Cloud, into &lt;code&gt;ReplacingMergeTree&lt;/code&gt; tables with the documents kept as JSON. It exists on ClickHouse Cloud only, is billed per ClickPipe, and leaves ClickHouse as the only reader.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;a href="https://clickhouse.com/docs/engines/table-engines/integrations/mongodb" rel="noopener noreferrer"&gt;MongoDB table engine&lt;/a&gt;.&lt;/strong&gt; No copy at all. ClickHouse reads the current document on every query, so the load you wanted to move stays on MongoDB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and the ClickHouse Kafka engine.&lt;/strong&gt; Changes land within seconds. You run Kafka, Kafka Connect and Debezium, add a materialized view per collection, and write the merge logic yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT) services such as Fivetran, Estuary or Airbyte Cloud.&lt;/strong&gt; Nothing to operate, with freshness in minutes depending on the plan. Pricing is per row, per GB or per connector, for a second copy you pay to move and store.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial builds a fifth one. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, reads the change stream and commits every collection as an Apache Iceberg table into Apache Polaris, an open source Iceberg REST (Representational State Transfer) catalog you run next to your own bucket. ClickHouse then attaches the whole catalog with one &lt;code&gt;CREATE DATABASE&lt;/code&gt; statement, and DuckDB and Trino read the same files.&lt;/p&gt;

&lt;p&gt;I ran all of it on 2026-10-29: MongoDB 7 as a single-node replica set, OLake Go v1.1.0, Polaris 1.8.0 on MinIO and ClickHouse 26.8.36, the long-term support (LTS) release. The first sync copied 48 documents in 15 seconds and the change sync took 8 seconds. Every figure below is from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  The MongoDB to ClickHouse pipeline you will build
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; a MongoDB database called &lt;code&gt;shop&lt;/code&gt; with two collections, &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Catalog and storage:&lt;/strong&gt; Polaris and MinIO in Docker, with the Parquet files in the bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI from its Docker Compose install, with one job that copies both collections and then follows the change stream.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readers:&lt;/strong&gt; ClickHouse through the &lt;code&gt;DataLakeCatalog&lt;/code&gt; engine, then DuckDB and Trino.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; Docker, MongoDB 4.0 or later running as a replica set (self-hosted or Atlas), ClickHouse 26.1 or later (the release where &lt;code&gt;DataLakeCatalog&lt;/code&gt; reads REST catalogs), and about 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Replica set, user and two collections
&lt;/h2&gt;

&lt;p&gt;MongoDB only produces change streams in replica set mode, because they are read from the oplog. One node counts. If yours is standalone, restart &lt;code&gt;mongod&lt;/code&gt; with &lt;code&gt;--replSet rs0&lt;/code&gt;, then open &lt;code&gt;mongosh&lt;/code&gt; on it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. Turn a single node into a replica set (skip this on Atlas)&lt;/span&gt;
&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rs0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;host&amp;gt;:27017"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 2. The user OLake Go logs in as&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"olake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"shop"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"clusterMonitor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 3. The oplog size in bytes&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oplog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxSize&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;read&lt;/code&gt; covers the first copy of the collections. The change stream needs oplog access, and that comes from &lt;code&gt;clusterMonitor&lt;/code&gt; (or &lt;code&gt;readAnyDatabase&lt;/code&gt;) in &lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Confirm both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stateStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// one PRIMARY&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSiblingDB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, the data. This script rebuilds the collections from my run: 8 customers with integer &lt;code&gt;_id&lt;/code&gt; values and 40 orders whose &lt;code&gt;amount&lt;/code&gt; is a &lt;code&gt;NumberDecimal&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Aarav Mehta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'aarav'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Priya Sharma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'priya'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Bengaluru'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'liam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Austin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Sofia Rossi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'sofia'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Milan'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Kenji Tanaka'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'kenji'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Tokyo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Emma Schulz'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'emma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Berlin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Noah Kim'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'noah'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Seoul'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'zara'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Dubai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;'@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Headphones'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7919&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;120000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two notes before you go on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Atlas.&lt;/strong&gt; The replica set and the oplog already exist. Create the user under &lt;strong&gt;Database Access&lt;/strong&gt; with &lt;code&gt;read&lt;/code&gt; on your database plus &lt;code&gt;clusterMonitor&lt;/code&gt;, and allow OLake Go's IP under &lt;strong&gt;Network Access&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The oplog is the replay window.&lt;/strong&gt; Atlas and most self-hosted installs keep 24 hours or less by default. OLake Go resumes from a token it saves after each sync, and once the oplog has rolled past that token the next sync has to begin with a fresh snapshot.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Run Polaris and MinIO, then create the catalog
&lt;/h2&gt;

&lt;p&gt;Three things have to exist before anything can be written: a Polaris server, a catalog inside it that points at a bucket, and a principal (a client id plus a secret) allowed to manage that catalog. Save this as &lt;code&gt;docker-compose.yml&lt;/code&gt; and run &lt;code&gt;docker compose up -d&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minio/minio&lt;/span&gt;
    &lt;span class="na"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lake-minio&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;server /data --console-address ":9001"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;MINIO_ROOT_USER:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;MINIO_ROOT_PASSWORD:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"9000:9000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"9001:9001"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apache/polaris:latest&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"8181:8181"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"8182:8182"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;AWS_REGION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;us-east-1&lt;/span&gt;
      &lt;span class="na"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;
      &lt;span class="na"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minioadmin&lt;/span&gt;
      &lt;span class="na"&gt;POLARIS_BOOTSTRAP_CREDENTIALS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POLARIS,root,&amp;lt;root-secret&amp;gt;&lt;/span&gt;
      &lt;span class="na"&gt;polaris.realm-context.realms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POLARIS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this file Polaris holds its state in memory and comes up empty after every restart. A production install backs it with Postgres. Once both containers are running, create the bucket, the catalog and the principal through the management API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;P&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:8181

&lt;span class="c"&gt;# 1. A bucket for the tables&lt;/span&gt;
aws --endpoint-url http://localhost:9000 s3 mb s3://lakehouse

&lt;span class="c"&gt;# 2. A root token&lt;/span&gt;
&lt;span class="nv"&gt;TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;curl -s &lt;span class="nv"&gt;$P&lt;/span&gt;/api/catalog/v1/oauth/tokens -H &lt;span class="s1"&gt;'Polaris-Realm: POLARIS'&lt;/span&gt; \
  -d &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials -d &lt;span class="nv"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root -d &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;root-secret&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  -d &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;PRINCIPAL_ROLE:ALL &lt;span class="o"&gt;|&lt;/span&gt; jq -r .access_token&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;H&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;-H &lt;span class="s2"&gt;"Authorization: Bearer $TOKEN"&lt;/span&gt; -H &lt;span class="s1"&gt;'Polaris-Realm: POLARIS'&lt;/span&gt; -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# 3. The catalog: where the files go, and how Polaris and the engines reach the store&lt;/span&gt;
curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs -d &lt;span class="s1"&gt;'{"catalog": {
  "name": "olake", "type": "INTERNAL", "readOnly": false,
  "properties": {"default-base-location": "s3://lakehouse/olake"},
  "storageConfigInfo": {"storageType": "S3", "allowedLocations": ["s3://lakehouse/olake"],
    "endpoint": "http://&amp;lt;minio-host&amp;gt;:9000/", "endpointInternal": "http://lake-minio:9000",
    "pathStyleAccess": true, "region": "us-east-1"}}}'&lt;/span&gt;

&lt;span class="c"&gt;# 4. A principal for OLake Go and the engines. Keep clientId and clientSecret from the response.&lt;/span&gt;
curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principals -d &lt;span class="s1"&gt;'{"principal": {"name": "olake"}}'&lt;/span&gt;

&lt;span class="c"&gt;# 5. Roles, and the grant that lets the principal create namespaces and tables&lt;/span&gt;
curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principal-roles -d &lt;span class="s1"&gt;'{"principalRole": {"name": "olake_role"}}'&lt;/span&gt;
curl -s &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs/olake/catalog-roles -d &lt;span class="s1"&gt;'{"catalogRole": {"name": "olake_catalog_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principals/olake/principal-roles -d &lt;span class="s1"&gt;'{"principalRole": {"name": "olake_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/principal-roles/olake_role/catalog-roles/olake -d &lt;span class="s1"&gt;'{"catalogRole": {"name": "olake_catalog_role"}}'&lt;/span&gt;
curl -s -X PUT &lt;span class="s2"&gt;"${H[@]}"&lt;/span&gt; &lt;span class="nv"&gt;$P&lt;/span&gt;/api/management/v1/catalogs/olake/catalog-roles/olake_catalog_role/grants -d &lt;span class="s1"&gt;'{"type": "catalog", "privilege": "CATALOG_MANAGE_CONTENT"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What to get right in that block:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;endpoint&lt;/code&gt; ends with a slash.&lt;/strong&gt; Polaris passes this store address to engines along with vended credentials. ClickHouse 26.8 and 26.10 build object paths from it, and when the slash is missing each read comes back as a 404.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;endpointInternal&lt;/code&gt; is the address Polaris itself uses.&lt;/strong&gt; MinIO needs both values, and on real S3 you leave both out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No underscores in hostnames.&lt;/strong&gt; Java's URI parser, which Polaris relies on, rejects a host such as &lt;code&gt;lab_minio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The secret is shown once.&lt;/strong&gt; Call 4 returns &lt;code&gt;clientId&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt;, used from here on as &lt;code&gt;&amp;lt;client_id&amp;gt;:&amp;lt;client_secret&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test the principal by trading its credentials for a token, the call OLake Go makes on each sync. A JSON object with an &lt;code&gt;access_token&lt;/code&gt; means it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s http://localhost:8181/api/catalog/v1/oauth/tokens -H &lt;span class="s1"&gt;'Polaris-Realm: POLARIS'&lt;/span&gt; \
  -d &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials -d &lt;span class="nv"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;client_id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; -d &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;client_secret&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  -d &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;PRINCIPAL_ROLE:ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add MongoDB as the source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and log in with &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;password&lt;/code&gt;. Under &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and choose &lt;strong&gt;MongoDB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Keep &lt;strong&gt;Enable CDC&lt;/strong&gt; on. My form had one host, &lt;code&gt;host.docker.internal:27017&lt;/code&gt;, because MongoDB ran in another container. The other fields were &lt;strong&gt;Database Name&lt;/strong&gt; &lt;code&gt;shop&lt;/code&gt;, &lt;strong&gt;Auth DB&lt;/strong&gt; &lt;code&gt;admin&lt;/code&gt;, username &lt;code&gt;olake&lt;/code&gt;, &lt;strong&gt;Replica Set&lt;/strong&gt; &lt;code&gt;rs0&lt;/code&gt; and &lt;strong&gt;Read Preference&lt;/strong&gt; &lt;code&gt;primary&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9y4om14n1bc3y4t4vw1k.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9y4om14n1bc3y4t4vw1k.webp" alt="OLake UI source form for MongoDB on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal:27017, database shop, auth DB admin, user olake and replica set rs0" width="790" height="1130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. OLake Go tests the connection, checks that the server is a replica set and that a change stream opens, and reports how long the oplog window is. If a check fails, the dialog names the setting and the value it recommends.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add Polaris as the destination
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Destinations&lt;/strong&gt;, click &lt;strong&gt;Create Destination&lt;/strong&gt;. Pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector, &lt;strong&gt;Polaris&lt;/strong&gt; as the catalog type and &lt;strong&gt;OAuth2&lt;/strong&gt; as the authentication type, then fill in the rest:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value in my run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:8181/api/catalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polaris Catalog Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;olake&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST Auth URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:8181/api/catalog/v1/oauth/tokens&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST Credential&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;client_id&amp;gt;:&amp;lt;client_secret&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST scope&lt;/td&gt;
&lt;td&gt;&lt;code&gt;PRINCIPAL_ROLE:ALL&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Region&lt;/td&gt;
&lt;td&gt;&lt;code&gt;us-east-1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S3 Endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://host.docker.internal:9000&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Access Key, AWS Secret Key&lt;/td&gt;
&lt;td&gt;the MinIO keys&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp57zzb1pgi6a6j7475p.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp57zzb1pgi6a6j7475p.webp" alt="OLake UI destination form for Apache Iceberg with catalog type Polaris, OAuth2 authentication, the REST catalog URI, Polaris catalog name olake, the MinIO S3 endpoint and region us-east-1" width="768" height="1018"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create&lt;/strong&gt; runs a real write test. OLake Go gets a token, creates a namespace and a test table through Polaris, writes to the bucket and drops the test table again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Under &lt;strong&gt;Jobs&lt;/strong&gt;, click &lt;strong&gt;Create Job&lt;/strong&gt;, name it &lt;code&gt;mongodb_to_clickhouse&lt;/code&gt; and pick a schedule. The schedule decides how often the change stream is drained, not how often a full copy runs.&lt;/p&gt;

&lt;p&gt;Select the source and the destination. Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to ClickHouse, DuckDB and Trino. From that list OLake Go resolves a delete format every one of them can read, and here it resolved equality deletes, which need no index between runs.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, set each to &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; with ingestion mode &lt;strong&gt;Upsert&lt;/strong&gt;, and leave &lt;strong&gt;Upsert Type&lt;/strong&gt; as resolved. Then click &lt;strong&gt;Create Job&lt;/strong&gt;, open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmui0v4pu6vk8k7hudx5v.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmui0v4pu6vk8k7hudx5v.webp" alt="OLake UI Streams page with customers and orders from the shop database selected, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Equality Deletes on Iceberg format version V2" width="799" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first run copied 8 customers and 40 orders, 48 documents and 6.40 KB in all, in &lt;strong&gt;15 seconds&lt;/strong&gt; with container start included. The job opens the change stream and saves its resume token before the copy starts, so nothing written during the snapshot is lost.&lt;/p&gt;

&lt;p&gt;The destination namespace is built from the job name and the source database, which gives &lt;code&gt;mongodb_to_clickhouse_shop&lt;/code&gt;. To change it, edit the &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Attach the catalog in ClickHouse and query
&lt;/h2&gt;

&lt;p&gt;No table has to be registered. In &lt;code&gt;clickhouse-client&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;allow_database_iceberg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;
&lt;span class="no"&gt;ENGINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DataLakeCatalog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;SETTINGS&lt;/span&gt;
  &lt;span class="n"&gt;catalog_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'rest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;warehouse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'olake'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;catalog_credential&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_id&amp;gt;:&amp;lt;client_secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;oauth_server_uri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog/v1/oauth/tokens'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;auth_scope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'PRINCIPAL_ROLE:ALL'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;vended_credentials&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'us-east-1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="sb"&gt;`mongodb_to_clickhouse_shop.customers`&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three details in that statement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The backticks.&lt;/strong&gt; ClickHouse has one level of namespace, so the Iceberg namespace and the table name sit together inside one quoted identifier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;vended_credentials = true&lt;/code&gt;.&lt;/strong&gt; ClickHouse reads the files with short-lived keys that Polaris issues per table, so no store keys are kept in ClickHouse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read-only.&lt;/strong&gt; &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt; and &lt;code&gt;RENAME DATABASE&lt;/code&gt; on this database return &lt;code&gt;NOT_IMPLEMENTED&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Money needs one more step. A &lt;code&gt;Decimal128&lt;/code&gt; field such as &lt;code&gt;amount&lt;/code&gt; arrives as &lt;code&gt;String&lt;/code&gt;, so cast it before you sum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;toDecimal64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="sb"&gt;`mongodb_to_clickhouse_shop.orders`&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leave the cast out and ClickHouse answers &lt;code&gt;Illegal type String of argument for aggregate function sum&lt;/code&gt;. My first roll-up hit exactly that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change documents in MongoDB and sync again
&lt;/h2&gt;

&lt;p&gt;Back in &lt;code&gt;mongosh&lt;/code&gt;, on database &lt;code&gt;shop&lt;/code&gt;, make 12 changes: 7 inserts and 5 updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1299.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'25.50'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'349.99'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'89.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'79.90'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 change events (1.60 KB)&lt;/strong&gt; from the stream and finished in &lt;strong&gt;8 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk1mx5l6rh3xo5a7lnriv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk1mx5l6rh3xo5a7lnriv.webp" alt="OLake UI job history for mongodb_to_clickhouse with two completed syncs, the first taking 15 seconds and the second 8 seconds" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sync log carries a commit report per collection. For &lt;code&gt;customers&lt;/code&gt; it reads &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedEqualityDeleteFiles=1&lt;/code&gt; and &lt;code&gt;addedEqualityDeletes=2&lt;/code&gt;. That is one data file holding the 2 inserts and the new versions of the 2 updated documents, and one small delete file that retires the 2 old versions by key.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; has the same shape, with 8 rows and 3 deletes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frvatccfuner4ooow8mmm.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frvatccfuner4ooow8mmm.webp" alt="OLake UI sync log filtered to the Iceberg commit report for orders: addedDataFiles 1, addedEqualityDeleteFiles 1, addedRecords 8, totalRecords 48 and addedEqualityDeletes 3" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the &lt;code&gt;SELECT&lt;/code&gt; from step 6 again. There is nothing to refresh: Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali is in Abu Dhabi, and Maya Patel and Lucas Silva have joined, which makes 10 rows with one per &lt;code&gt;_id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dcger9fw4iskqzz7pwh.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dcger9fw4iskqzz7pwh.webp" alt="clickhouse-client querying the customers table in the polaris database and returning 10 rows with _id, name, city and tier after the change sync" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each table also carries columns OLake Go adds, among them &lt;code&gt;_op_type&lt;/code&gt;: &lt;code&gt;r&lt;/code&gt; for a snapshot row, &lt;code&gt;c&lt;/code&gt; for an insert, &lt;code&gt;u&lt;/code&gt; for an update and &lt;code&gt;d&lt;/code&gt; for a delete. On MongoDB tables there is &lt;code&gt;_cdc_resume_token&lt;/code&gt; too, the change stream token each change came from.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema changes.&lt;/strong&gt; A field that shows up in new documents becomes a column on the next sync, and ClickHouse shows it the next time the table is opened, with nulls for older rows. A field whose type changes in an incompatible way fails the sync rather than corrupt the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB and Trino
&lt;/h2&gt;

&lt;p&gt;Neither engine needs an export. DuckDB attaches Polaris with the principal's client id and secret, and fetches the token itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;polaris_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;CLIENT_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CLIENT_SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;client_secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;OAUTH2_SERVER_URI&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog/v1/oauth/tokens'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;OAUTH2_SCOPE&lt;/span&gt; &lt;span class="s1"&gt;'PRINCIPAL_ROLE:ALL'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- MinIO, or any store whose address differs from the one Polaris vends&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;store_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;secret key&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;minio-host&amp;gt;:9000'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;URL_STYLE&lt;/span&gt; &lt;span class="s1"&gt;'path'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;USE_SSL&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;REGION&lt;/span&gt; &lt;span class="s1"&gt;'us-east-1'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'olake'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'http://&amp;lt;polaris-host&amp;gt;:8181/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;polaris_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;polaris&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_clickhouse_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;store_secret&lt;/code&gt; and &lt;code&gt;ACCESS_DELEGATION_MODE 'none'&lt;/code&gt; are for a laptop, where the store address Polaris hands out may not resolve. With Polaris on AWS S3, remove both and DuckDB reads with the vended credentials.&lt;/p&gt;

&lt;p&gt;Trino needs one catalog properties file, &lt;code&gt;etc/catalog/polaris.properties&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;connector.name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;iceberg&lt;/span&gt;
&lt;span class="na"&gt;iceberg.catalog.type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;rest&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//&amp;lt;polaris-host&amp;gt;:8181/api/catalog&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.warehouse&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;olake&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.security&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;OAUTH2&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.oauth2.credential&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;:&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.oauth2.scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;PRINCIPAL_ROLE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;ALL&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.oauth2.server-uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//&amp;lt;polaris-host&amp;gt;:8181/api/catalog/v1/oauth/tokens&lt;/span&gt;
&lt;span class="na"&gt;iceberg.rest-catalog.vended-credentials-enabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;fs.native-s3.enabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;s3.region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;us&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;east&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="c1"&gt;# MinIO or another S3-compatible store only:
&lt;/span&gt;&lt;span class="na"&gt;s3.endpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//&amp;lt;minio-host&amp;gt;:9000&lt;/span&gt;
&lt;span class="na"&gt;s3.path-style-access&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;SELECT&lt;/code&gt; is the same one DuckDB ran.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjji3w8miypm7colnk075.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjji3w8miypm7colnk075.webp" alt="Trino 484 command line client querying customers in the polaris catalog and returning the same 10 rows as ClickHouse" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DuckDB 1.5.5 and Trino 484 gave back the same 10 rows as ClickHouse. An &lt;code&gt;orders&lt;/code&gt; roll-up matched MongoDB to the cent in all three, each casting &lt;code&gt;amount&lt;/code&gt; first: 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips and limits from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Documents are flattened one level.&lt;/strong&gt; Nested objects and arrays arrive as JSON text in a &lt;code&gt;String&lt;/code&gt; column, which you parse with &lt;code&gt;JSONExtract&lt;/code&gt; or &lt;code&gt;JSONExtractString&lt;/code&gt;. If every query would start that way, ClickHouse's own JSON column type on a MergeTree table may serve you better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An &lt;code&gt;ObjectId&lt;/code&gt; key becomes its 24-character hex string.&lt;/strong&gt; The integer &lt;code&gt;_id&lt;/code&gt; keys in this run arrived as &lt;code&gt;Nullable(Int32)&lt;/code&gt;, and a MongoDB &lt;code&gt;date&lt;/code&gt; as &lt;code&gt;Nullable(DateTime64(6, 'UTC'))&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;There is no primary index.&lt;/strong&gt; A &lt;code&gt;DataLakeCatalog&lt;/code&gt; query reads Parquet over the network. For a dashboard that needs sub-second answers, load the hot slice into a MergeTree table on a schedule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nothing compacts the tables for you.&lt;/strong&gt; Each sync adds a small data file and a delete file per collection. Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Polaris endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No deletion vectors on ClickHouse 26.8.&lt;/strong&gt; That LTS release reads positional and equality deletes only, so keep the upsert type OLake Go resolves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The oplog is sized in gigabytes, not hours.&lt;/strong&gt; A write-heavy cluster shortens the window, so check it after a busy day.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the methods compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ClickPipes for MongoDB&lt;/td&gt;
&lt;td&gt;CDC through change streams&lt;/td&gt;
&lt;td&gt;Yes, into &lt;code&gt;ReplacingMergeTree&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;ClickHouse Cloud tables with documents as JSON; one reader&lt;/td&gt;
&lt;td&gt;Nothing; ClickHouse Cloud only, billed per ClickPipe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MongoDB table engine&lt;/td&gt;
&lt;td&gt;Live, per query&lt;/td&gt;
&lt;td&gt;Reads the current document&lt;/td&gt;
&lt;td&gt;Nothing is copied; each query hits MongoDB&lt;/td&gt;
&lt;td&gt;A MongoDB user for ClickHouse&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, Kafka engine&lt;/td&gt;
&lt;td&gt;Seconds&lt;/td&gt;
&lt;td&gt;Yes, with your own merge logic&lt;/td&gt;
&lt;td&gt;Kafka topics, then ClickHouse tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a view per collection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed ELT&lt;/td&gt;
&lt;td&gt;Minutes, by plan&lt;/td&gt;
&lt;td&gt;Varies by tool&lt;/td&gt;
&lt;td&gt;ClickHouse tables, a second copy&lt;/td&gt;
&lt;td&gt;Nothing; per row, per GB or per connector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go to Polaris (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;Yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables for ClickHouse, DuckDB, Trino and Spark&lt;/td&gt;
&lt;td&gt;One Docker Compose stack, open source; your bucket and compute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On ClickHouse Cloud, with ClickHouse as the only reader and MergeTree speed required, ClickPipes is the simpler choice. The Iceberg route pays off once another engine needs the same rows, or when you want to own the files and the catalog.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Do I have to refresh the ClickHouse database after each sync?
&lt;/h3&gt;

&lt;p&gt;No. Each sync ends with one commit to Polaris, and ClickHouse picks up the new snapshot on its next query. No engine keeps a copy of the data, so there is nothing to reload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run the pipeline without OLake UI?
&lt;/h3&gt;

&lt;p&gt;Yes, with the &lt;code&gt;olakego/source-mongodb:latest&lt;/code&gt; image. &lt;code&gt;check&lt;/code&gt; tests your &lt;code&gt;source.json&lt;/code&gt;, &lt;code&gt;discover&lt;/code&gt; writes the stream files, and &lt;code&gt;sync&lt;/code&gt; runs the job with &lt;code&gt;sync_mode&lt;/code&gt; set to &lt;code&gt;cdc&lt;/code&gt; and &lt;code&gt;update_type&lt;/code&gt; set to &lt;code&gt;eq&lt;/code&gt;. Later runs add &lt;code&gt;--state /mnt/config/state.json&lt;/code&gt;, so only the changes since the previous run are replayed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if the job is paused for longer than the oplog window?
&lt;/h3&gt;

&lt;p&gt;The saved resume token is no longer in the oplog, so the stream cannot resume and the job needs a fresh snapshot. The source test reports the current window and warns when it is under 7 days. Size the oplog for your longest planned pause.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at Atlas: one SRV host with &lt;strong&gt;Use SRV&lt;/strong&gt; on, and the minimum oplog window set to cover your longest pause between syncs.&lt;/li&gt;
&lt;li&gt;Replace MinIO with an S3 bucket and an Identity and Access Management (IAM) role, and put Postgres behind Polaris so the catalog survives a restart.&lt;/li&gt;
&lt;li&gt;The full guide, with the complete data type table and the troubleshooting list, is on &lt;a href="https://olake.io/docs/integrations/mongodb-to-clickhouse/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your machine, leave a comment and I will correct the post.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>clickhouse</category>
    </item>
    <item>
      <title>MongoDB to BigQuery Without Datastream or Kafka: A Change Stream CDC Tutorial</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:03:51 +0000</pubDate>
      <link>https://dev.to/shubham_olake/mongodb-to-bigquery-without-datastream-or-kafka-a-change-stream-cdc-tutorial-ob9</link>
      <guid>https://dev.to/shubham_olake/mongodb-to-bigquery-without-datastream-or-kafka-a-change-stream-cdc-tutorial-ob9</guid>
      <description>&lt;p&gt;BigQuery wants columns, and MongoDB hands you documents that get rewritten in place. A MongoDB to BigQuery pipeline has to close both gaps: turn fields into columns, and carry every update and delete across instead of shipping yesterday's export.&lt;/p&gt;

&lt;p&gt;The common ways to move the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;mongoexport&lt;/code&gt; to JSON, then &lt;code&gt;bq load&lt;/code&gt;.&lt;/strong&gt; A script, a scheduler and a staging bucket. Freshness is hours to daily, and every run is a full reload, so updates and deletes never arrive as changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/datastream/docs/overview" rel="noopener noreferrer"&gt;Datastream for MongoDB&lt;/a&gt;.&lt;/strong&gt; Google's managed service reads change streams into native BigQuery datasets, near real time by Google's description. There is nothing to run, and BigQuery is the only reader of the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and a BigQuery sink.&lt;/strong&gt; Changes arrive in seconds, and you operate Kafka, Kafka Connect, Debezium and a sink connector per collection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT) tools such as Fivetran, Estuary or Airbyte Cloud.&lt;/strong&gt; Nothing to host, and freshness in minutes depending on the plan. You pay per row, per GB or per connector for a second copy in BigQuery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial takes a fifth route. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, reads the MongoDB change stream with change data capture (CDC) and commits each collection as an Apache Iceberg table into BigLake, Google Cloud's Iceberg representational state transfer (REST) catalog. The files stay in a Cloud Storage bucket you own, and BigQuery reads them in place.&lt;/p&gt;

&lt;p&gt;I ran it against MongoDB 7 as a single-node replica set in Docker and a bucket in &lt;code&gt;us-central1&lt;/code&gt;, with OLake Go v1.1.0. The first sync copied 48 documents in 34 seconds, and a second sync replayed 12 change events in 33 seconds. Every figure in this post is from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need for this MongoDB to BigQuery pipeline
&lt;/h2&gt;

&lt;p&gt;MongoDB 4.0 or later running as a replica set (self-hosted or Atlas), Docker, and a Google Cloud project where you can enable an API and create a service account. The account that runs the BigQuery queries needs the BigQuery Job User role plus read access to the catalog. Set aside about 30 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: A replica set, a user and two collections
&lt;/h2&gt;

&lt;p&gt;Change streams exist only in replica set mode, and one node is enough. On a self-hosted server, start &lt;code&gt;mongod&lt;/code&gt; with &lt;code&gt;--replSet rs0&lt;/code&gt; and run this in &lt;code&gt;mongosh&lt;/code&gt; on the primary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rs0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;host&amp;gt;:27017"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"olake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"shop"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"clusterMonitor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// oplog size in bytes; raise it with replSetResizeOplog if it is small&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oplog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxSize&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;read&lt;/code&gt; role lets OLake Go copy the collections. &lt;code&gt;clusterMonitor&lt;/code&gt; (or &lt;code&gt;readAnyDatabase&lt;/code&gt;) grants the oplog access that the change stream needs.&lt;/p&gt;

&lt;p&gt;Confirm there is one &lt;code&gt;PRIMARY&lt;/code&gt; and that the user exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stateStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSiblingDB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, the data. Use your own collections, or seed the same 8 customers and 40 orders I used, with money stored as &lt;code&gt;NumberDecimal&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;seededAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Aarav Mehta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Priya Sharma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Bengaluru'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'Austin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Sofia Rossi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'Milan'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Kenji Tanaka'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Tokyo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Emma Schulz'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'Berlin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Noah Kim'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'Seoul'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'Dubai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;'@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seededAt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seededAt&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Headphones'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7919&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;120000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seededAt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;seededAt&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Atlas, skip &lt;code&gt;rs.initiate&lt;/code&gt;, because clusters are already replica sets. Create the user under &lt;strong&gt;Database Access&lt;/strong&gt; with the same two roles, and allow OLake Go's IP under &lt;strong&gt;Network Access&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The oplog is the replay window. Atlas and most self-hosted installs keep 24 hours or less of it by default, and a job paused past that window cannot resume and needs a fresh snapshot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Bucket, service account and key on Google Cloud
&lt;/h2&gt;

&lt;p&gt;All of this happens in the Google Cloud console.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable the BigLake API&lt;/strong&gt; under &lt;strong&gt;APIs and services&lt;/strong&gt;, &lt;strong&gt;Enable APIs and services&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a bucket&lt;/strong&gt; in &lt;strong&gt;Cloud Storage&lt;/strong&gt;, in the region where BigQuery will run the queries. Its name becomes the catalog name in BigQuery SQL, so choose one you do not mind typing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a service account&lt;/strong&gt; under &lt;strong&gt;IAM and Admin&lt;/strong&gt;, &lt;strong&gt;Service Accounts&lt;/strong&gt;. IAM is short for Identity and Access Management. Grant the account &lt;strong&gt;BigLake Editor&lt;/strong&gt; on the project and &lt;strong&gt;Storage Object User&lt;/strong&gt; on the bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download a JSON key&lt;/strong&gt; from the service account's &lt;strong&gt;Keys&lt;/strong&gt; tab: &lt;strong&gt;Add key&lt;/strong&gt;, &lt;strong&gt;Create new key&lt;/strong&gt;, &lt;strong&gt;JSON&lt;/strong&gt;. The console hands it over once.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb00zzq0gao87jkwbdcwq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb00zzq0gao87jkwbdcwq.webp" alt="Google Cloud console IAM Grant access panel with the OLake service account as the principal and the BigLake Editor role selected" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvebmy14ndujv5jv246o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvebmy14ndujv5jv246o.webp" alt="Google Cloud console Create private key dialog for the OLake service account with the JSON key type selected" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You do not create the catalog yourself. BigLake makes a single-bucket catalog named after the bucket the first time OLake Go calls the endpoint with &lt;code&gt;gs://&amp;lt;bucket&amp;gt;&lt;/code&gt; as the catalog path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and connect MongoDB
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in with &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Sources&lt;/strong&gt;, &lt;strong&gt;Create Source&lt;/strong&gt; and pick &lt;strong&gt;MongoDB&lt;/strong&gt;. Leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on, then fill in the connection details. Mine were host &lt;code&gt;host.docker.internal:27017&lt;/code&gt; (MongoDB ran in another container), &lt;strong&gt;Database Name&lt;/strong&gt; &lt;code&gt;shop&lt;/code&gt;, &lt;strong&gt;Auth DB&lt;/strong&gt; &lt;code&gt;admin&lt;/code&gt;, user &lt;code&gt;olake&lt;/code&gt; and &lt;strong&gt;Replica Set&lt;/strong&gt; &lt;code&gt;rs0&lt;/code&gt;, with &lt;strong&gt;Read Preference&lt;/strong&gt; left on &lt;code&gt;primary&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21zz13q33v1q66018zhu.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21zz13q33v1q66018zhu.webp" alt="OLake UI MongoDB source form on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal:27017, database shop, auth DB admin, user olake and replica set rs0" width="770" height="1531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. OLake Go tests the connection, confirms that it can open a change stream, and reports the oplog window. A window under 7 days is shown as a warning, not a blocker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Point the destination at BigLake
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt;, &lt;strong&gt;Create Destination&lt;/strong&gt;, choose &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector and &lt;strong&gt;BigLake&lt;/strong&gt; as the catalog type.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://biglake.googleapis.com/iceberg/v1/restcatalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BigLake Catalog Path&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;gs://&amp;lt;bucket&amp;gt;&lt;/code&gt;, with no folder after it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication Type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GCP&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Service Account JSON&lt;/td&gt;
&lt;td&gt;the full contents of the key file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catalog Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;olake_iceberg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCP Project ID&lt;/td&gt;
&lt;td&gt;your project ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enable Arrow Writes&lt;/td&gt;
&lt;td&gt;off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ov5a0u564vnjlr14sw6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ov5a0u564vnjlr14sw6.webp" alt="OLake UI Iceberg destination form with catalog type Big Lake, the BigLake REST catalog URI, a gs bucket as the catalog path, GCP authentication and the project ID" width="790" height="1050"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create&lt;/strong&gt; runs a test: OLake Go calls the endpoint, creates the catalog on first contact, then writes and drops a test table in the bucket. A missing role fails this test with a &lt;code&gt;403&lt;/code&gt; from &lt;code&gt;biglake.googleapis.com&lt;/code&gt; or &lt;code&gt;storage.googleapis.com&lt;/code&gt;, and the host tells you which grant to add.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Keep the catalog in its default end-user credential mode. OLake Go 1.1.0 does not send the &lt;code&gt;X-Iceberg-Access-Delegation&lt;/code&gt; header, so a catalog switched to vended credentials rejects its commits.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Jobs&lt;/strong&gt;, click &lt;strong&gt;Create Job&lt;/strong&gt;, name it &lt;code&gt;mongodb_to_bigquery&lt;/code&gt;, set a schedule and select the source and destination.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Google BigQuery, Apache Spark and DuckDB. OLake Go then offers only the delete formats all three can read, which are equality and positional deletes. Deletion vectors drop off the list because BigQuery reads them only in preview.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;, tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, and keep &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; with &lt;strong&gt;Upsert&lt;/strong&gt;. The &lt;strong&gt;Upsert Type&lt;/strong&gt; in my run was &lt;strong&gt;Positional Deletes&lt;/strong&gt;. Then click &lt;strong&gt;Create Job&lt;/strong&gt;, and choose &lt;strong&gt;Sync Now&lt;/strong&gt; from the job's menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fspu9tace910qludgxob6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fspu9tace910qludgxob6.webp" alt="OLake UI Streams Selection page with customers and orders ticked, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Positional Deletes" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first sync copied 8 customers and 40 orders (48 documents, 6.40 KB) in &lt;strong&gt;34 seconds&lt;/strong&gt;, container start included. It opened the change stream and saved a resume token before reading the collections in parallel chunks, so writes made during the copy are not lost.&lt;/p&gt;

&lt;p&gt;OLake Go names the BigLake namespace after the job and the source database, which gave &lt;code&gt;mongodb_to_bigquery_shop&lt;/code&gt;. The &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page changes that before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the collections in BigQuery
&lt;/h2&gt;

&lt;p&gt;There is no dataset to create and no external table to declare. In BigQuery the bucket is the catalog, the namespace is the dataset, and you address a table by a four-part name in backticks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.mongodb_to_bigquery_shop.customers`&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(cast(amount AS NUMERIC)), 2) AS total
FROM `&amp;lt;project-id&amp;gt;.&amp;lt;bucket&amp;gt;.mongodb_to_bigquery_shop.orders`
GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter. Run the query in the bucket's region, which you set in the editor under &lt;strong&gt;More&lt;/strong&gt;, &lt;strong&gt;Query settings&lt;/strong&gt;. And cast &lt;code&gt;amount&lt;/code&gt;, because a &lt;code&gt;Decimal128&lt;/code&gt; field arrives in BigQuery as &lt;code&gt;STRING&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From a terminal, the same statements run with &lt;code&gt;bq&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bq query --project_id=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;project-id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --location=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;region&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --use_legacy_sql=false &lt;span class="s2"&gt;"&amp;lt;sql&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 7: Change documents and sync again
&lt;/h2&gt;

&lt;p&gt;Now the part a nightly export cannot do. Back in &lt;code&gt;mongosh&lt;/code&gt;, on database &lt;code&gt;shop&lt;/code&gt;, make 12 changes: 7 inserts and 5 updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1299.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'25.50'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'349.99'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'89.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'79.90'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 change events (1.60 KB)&lt;/strong&gt; from the stream and finished in &lt;strong&gt;33 seconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffkpvsrp417yrpqejaojv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffkpvsrp417yrpqejaojv.webp" alt="OLake UI Job Logs and History showing two completed syncs for the job, one with a runtime of 34 seconds and one with 33 seconds" width="799" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt;, OLake Go wrote one new data file holding 4 rows: the 2 inserts and the new versions of the 2 updated documents. One small positional delete file retires the 2 old versions. The commit report in the sync log says the same thing: &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedPositionalDeleteFiles=1&lt;/code&gt;, &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd5shjrzimdohp3rkvtc6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd5shjrzimdohp3rkvtc6.webp" alt="OLake UI sync log filtered to the Iceberg commit report for customers, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 4 and addedPositionalDeletes 2" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; has the same shape, with 8 rows and 3 deletes. Rerun the first &lt;code&gt;SELECT&lt;/code&gt; in BigQuery, with no refresh and no &lt;code&gt;ALTER TABLE&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fij062nwno4pgmyu0zspn.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fij062nwno4pgmyu0zspn.webp" alt="BigQuery SQL editor in the Google Cloud console running the customers query on the BigLake catalog and returning 10 rows with _id, name, city and tier" width="799" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali has moved to Abu Dhabi, and customers 9 and 10 are present. BigQuery applies the positional deletes while reading, so each key still returns one row. Add &lt;code&gt;_op_type&lt;/code&gt; to the query to see how each row arrived: &lt;code&gt;r&lt;/code&gt; for the snapshot, &lt;code&gt;c&lt;/code&gt; for an insert and &lt;code&gt;u&lt;/code&gt; for an update.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB
&lt;/h2&gt;

&lt;p&gt;No export is involved here. DuckDB attaches the BigLake catalog with a Google access token and reads the files OLake Go wrote.&lt;/p&gt;

&lt;p&gt;Because the catalog is in end-user mode, DuckDB brings its own storage credentials. That is a hash-based message authentication code (HMAC) key for the service account, created under Cloud Storage, &lt;strong&gt;Settings&lt;/strong&gt;, &lt;strong&gt;Interoperability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8os7e8upnrrh3z6ymev.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8os7e8upnrrh3z6ymev.webp" alt="Google Cloud console Cloud Storage Interoperability settings with the Select a service account dialog and the OLake service account selected for a new key" width="800" height="348"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- gcloud auth print-access-token, or a token minted for the service account&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access token&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;EXTRA_HTTP_HEADERS&lt;/span&gt; &lt;span class="no"&gt;MAP&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'x-goog-user-project'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;project-id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- the HMAC key pair for the bucket&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_files&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;gcs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;KEY_ID&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac access id&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hmac secret&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'gs://&amp;lt;bucket&amp;gt;'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://biglake.googleapis.com/iceberg/v1/restcatalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;biglake_catalog&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;biglake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_bigquery_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers as BigQuery, and Spark 4.0.1 with Iceberg 1.10.0 did as well. The &lt;code&gt;orders&lt;/code&gt; roll-up matched MongoDB to the cent in all three engines: 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25. In DuckDB and Spark the cast is &lt;code&gt;sum(cast(amount AS decimal(12,2)))&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The access token lasts an hour. When a query fails with &lt;code&gt;401&lt;/code&gt;, run &lt;code&gt;CREATE OR REPLACE SECRET&lt;/code&gt; with a fresh one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips from the run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Documents are flattened one level.&lt;/strong&gt; Top-level fields become columns. Nested objects and arrays arrive as JSON text in a &lt;code&gt;STRING&lt;/code&gt; column, which &lt;code&gt;PARSE_JSON&lt;/code&gt; or &lt;code&gt;JSON_VALUE&lt;/code&gt; can unpack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store doubles if you want to skip the cast.&lt;/strong&gt; &lt;code&gt;Decimal128&lt;/code&gt; always arrives as text, and an &lt;code&gt;ObjectId&lt;/code&gt; key arrives as its 24-character hex string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new field becomes a new column&lt;/strong&gt; on the next sync, with nulls for older rows. A field whose type changes in an incompatible way fails the sync instead of corrupting the table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch &lt;code&gt;metadata.json&lt;/code&gt;.&lt;/strong&gt; BigLake keeps every snapshot in it and rejects a file above 1 MB, which a busy table reaches after a few thousand syncs. Expire snapshots and compact on a schedule with Spark's &lt;code&gt;expire_snapshots&lt;/code&gt; and &lt;code&gt;rewrite_data_files&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the MongoDB to BigQuery options compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mongoexport&lt;/code&gt; plus &lt;code&gt;bq load&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads only&lt;/td&gt;
&lt;td&gt;native BigQuery tables&lt;/td&gt;
&lt;td&gt;a script, a scheduler, a staging bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Datastream for MongoDB&lt;/td&gt;
&lt;td&gt;near real time, by Google's description&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native BigQuery datasets&lt;/td&gt;
&lt;td&gt;nothing; a stream in the console&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, BigQuery sink&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, in upsert mode&lt;/td&gt;
&lt;td&gt;Kafka topics, then BigQuery tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, sinks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Managed ELT&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;varies by tool&lt;/td&gt;
&lt;td&gt;a second copy in BigQuery&lt;/td&gt;
&lt;td&gt;nothing; per row, GB or connector pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go to BigLake (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;yes, as row-level deletes&lt;/td&gt;
&lt;td&gt;open tables BigQuery, Spark and DuckDB read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, your bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Datastream is the simpler choice when BigQuery is the only reader and you prefer a managed Google service. The route in this post has two more limits worth stating plainly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A catalog table is read from Parquet in the bucket on every query, so it will not match native BigQuery speed. Load the hot slice into a native table on a schedule if a dashboard needs that.&lt;/li&gt;
&lt;li&gt;Deletion vectors are out while BigQuery is a reader. BigQuery reads them only in preview, with a cap of 100,000 deletion vector entries per query.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How fresh can the BigQuery tables be?
&lt;/h3&gt;

&lt;p&gt;As fresh as the job's schedule, which goes down to one minute. Each run drains the change stream and ends with one commit to BigLake, and BigQuery sees that snapshot on its next query. It is CDC on a schedule, not a continuous stream.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run this from the command line instead of the UI?
&lt;/h3&gt;

&lt;p&gt;Yes. The &lt;code&gt;olakego/source-mongodb:latest&lt;/code&gt; image has &lt;code&gt;check&lt;/code&gt;, &lt;code&gt;discover&lt;/code&gt; and &lt;code&gt;sync&lt;/code&gt; commands driven by JSON config files. Positional deletes keep a small index between runs, so mount a persistent directory through &lt;code&gt;OLAKE_INDEX_DB_DIR&lt;/code&gt; and pass &lt;code&gt;--state&lt;/code&gt; on every run after the first.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does it cost to keep running?
&lt;/h3&gt;

&lt;p&gt;Storage is billed at Cloud Storage rates for the Parquet and delete files, and the BigLake catalog has no per-table charge. BigQuery bills queries by bytes scanned on demand, or by slot time on an edition. OLake Go runs on whatever machine hosts Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your real replica set or Atlas cluster. On Atlas, paste the cluster host with &lt;strong&gt;Use SRV&lt;/strong&gt; on.&lt;/li&gt;
&lt;li&gt;The full guide, with the CLI configs, the Spark connection and the complete data type table, is on &lt;a href="https://olake.io/docs/integrations/mongodb-to-bigquery/" rel="noopener noreferrer"&gt;olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If something here does not match what you see, post the exact message in the comments.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>bigquery</category>
    </item>
    <item>
      <title>MongoDB to Databricks: Turn Collections Into Unity Catalog Tables With Change Streams</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Sun, 22 Nov 2026 18:53:48 +0000</pubDate>
      <link>https://dev.to/shubham_olake/mongodb-to-databricks-turn-collections-into-unity-catalog-tables-with-change-streams-50ga</link>
      <guid>https://dev.to/shubham_olake/mongodb-to-databricks-turn-collections-into-unity-catalog-tables-with-change-streams-50ga</guid>
      <description>&lt;p&gt;An order document in MongoDB does not stay still. It is placed, then shipped, then delivered, and each step rewrites the same document in place. A Databricks table loaded from last night's export holds only one of those states, and closing that gap is what most MongoDB to Databricks pipelines are really for.&lt;/p&gt;

&lt;p&gt;The common ways to move the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Export files.&lt;/strong&gt; &lt;code&gt;mongoexport&lt;/code&gt; writes JSON files to a cloud bucket, and &lt;a href="https://docs.databricks.com/gcp/en/ingestion/cloud-object-storage/copy-into/" rel="noopener noreferrer"&gt;COPY INTO&lt;/a&gt; or &lt;a href="https://docs.databricks.com/gcp/en/ingestion/cloud-object-storage/auto-loader/" rel="noopener noreferrer"&gt;Auto Loader&lt;/a&gt; loads them. Freshness is hours to daily, and an updated or deleted document only arrives through a full reload or a merge you write yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium and Kafka, read with &lt;a href="https://docs.databricks.com/gcp/en/connect/streaming/kafka" rel="noopener noreferrer"&gt;Structured Streaming&lt;/a&gt;.&lt;/strong&gt; Changes arrive within seconds. In return you run Kafka, Kafka Connect, Debezium and a Databricks job that has to keep running, and the merge logic is yours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial builds a third option. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, does change data capture (CDC) from MongoDB change streams and commits each collection as an Apache Iceberg table into Unity Catalog. Databricks shows the result as managed Iceberg tables with one column per top-level field, and DuckDB and Spark can query the same tables through the same catalog.&lt;/p&gt;

&lt;p&gt;I ran it against MongoDB 7 as a single-node replica set and a Databricks workspace on Google Cloud, using OLake Go v1.1.0. The first sync copied 48 documents in 23 seconds, and the second replayed 12 changes in 16 seconds. Those figures, and every other one below, come from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB 4.0 or later running as a replica set, self-hosted or on Atlas. Mine was a database called &lt;code&gt;shop&lt;/code&gt; with two collections, &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A Databricks workspace with Unity Catalog, a catalog with managed storage, and an admin who can turn on external data access and grant &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Docker, for OLake UI, and about 30 minutes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Prepare MongoDB for CDC
&lt;/h2&gt;

&lt;p&gt;OLake Go reads changes through change streams, and MongoDB builds those on the replica set oplog. So the server has to run in replica set mode, and one node is enough.&lt;/p&gt;

&lt;p&gt;On a self-hosted server, start &lt;code&gt;mongod&lt;/code&gt; with &lt;code&gt;--replSet rs0&lt;/code&gt; and run this in &lt;code&gt;mongosh&lt;/code&gt; on the primary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. A single-node replica set, if you do not have one (self-hosted only)&lt;/span&gt;
&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rs0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;host&amp;gt;:27017"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 2. A user for OLake Go&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"olake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"shop"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"clusterMonitor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// 3. Check the oplog size; OLake Go warns when the window is below 7 days&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oplog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxSize&lt;/span&gt;      &lt;span class="c1"&gt;// bytes; raise with replSetResizeOplog if it is small&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first copy of the collections needs &lt;code&gt;read&lt;/code&gt; on the database, and the change stream needs the oplog access that &lt;code&gt;clusterMonitor&lt;/code&gt; (or &lt;code&gt;readAnyDatabase&lt;/code&gt;) grants. Confirm both pieces before you go on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stateStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// one PRIMARY&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSiblingDB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point OLake Go at collections you already have, or create two like mine. My &lt;code&gt;shop&lt;/code&gt; database started with 8 customers and 40 orders, with integer &lt;code&gt;_id&lt;/code&gt; values and money stored as &lt;code&gt;NumberDecimal&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Aarav Mehta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'aarav@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// ... more customers with integer _id values; step 7 updates 'Liam Carter' and 'Zara Ali'&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Headphones'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'99.19'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// ... more orders with the same fields&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On MongoDB Atlas the replica set and the oplog already exist. Create the user under &lt;strong&gt;Database Access&lt;/strong&gt; with the &lt;code&gt;read&lt;/code&gt; role on your database plus &lt;code&gt;clusterMonitor&lt;/code&gt;, and allow OLake Go's IP under &lt;strong&gt;Network Access&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The oplog is your replay window, and Atlas and most self-hosted installs keep 24 hours or less of it by default. If the saved change stream token has rolled out of the oplog when the next sync starts, OLake Go needs a fresh snapshot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Set up Unity Catalog in Databricks
&lt;/h2&gt;

&lt;p&gt;Unity Catalog is the catalog built into every Databricks workspace, and OLake Go writes to it through its Iceberg REST (representational state transfer) endpoint. Databricks allows writes through that endpoint for managed Iceberg tables only (&lt;a href="https://docs.databricks.com/gcp/en/external-access/iceberg" rel="noopener noreferrer"&gt;Databricks: access tables from Iceberg clients&lt;/a&gt;). Four things have to be in place, once:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;External data access&lt;/strong&gt; on the metastore&lt;/td&gt;
&lt;td&gt;Catalog, the gear icon, &lt;strong&gt;Metastore&lt;/strong&gt;, then &lt;strong&gt;External data access&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A catalog with managed storage&lt;/td&gt;
&lt;td&gt;Catalog, &lt;strong&gt;Create catalog&lt;/strong&gt;, with a storage location backed by an external location&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt; for the writing principal&lt;/td&gt;
&lt;td&gt;On the catalog, in the SQL below&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A personal access token&lt;/td&gt;
&lt;td&gt;Settings, &lt;strong&gt;Developer&lt;/strong&gt;, &lt;strong&gt;Access tokens&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then run this in the Databricks SQL editor with your own principal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- The catalog OLake Go writes into. Its managed storage holds the Iceberg files.&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="no"&gt;MANAGED&lt;/span&gt; &lt;span class="no"&gt;LOCATION&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;external location URL&amp;gt;/lakehouse'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- What the writing principal needs: browse and create schemas, then read and write tables in them&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MODIFY&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL&lt;/span&gt; &lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="sb"&gt;`olake@example.com`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the grants sit on the catalog, every schema OLake Go creates later inherits them. My catalog was named &lt;code&gt;datazip&lt;/code&gt;, and my token expired after seven days. The SQL here says &lt;code&gt;lakehouse&lt;/code&gt;, so swap in your own catalog name.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt; is not part of &lt;code&gt;ALL PRIVILEGES&lt;/code&gt;, and only the catalog owner can grant it (&lt;a href="https://docs.databricks.com/gcp/en/data-governance/unity-catalog/manage-privileges/privileges" rel="noopener noreferrer"&gt;Databricks: Unity Catalog privileges&lt;/a&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and connect MongoDB
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in with &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and pick &lt;strong&gt;MongoDB&lt;/strong&gt; as the connector. Under &lt;strong&gt;Change data capture (CDC)&lt;/strong&gt;, leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Connection details&lt;/strong&gt;, add the host as &lt;code&gt;host:port&lt;/code&gt;, then the &lt;strong&gt;Database Name&lt;/strong&gt;, &lt;strong&gt;Auth DB&lt;/strong&gt;, username, password and &lt;strong&gt;Replica Set&lt;/strong&gt; name. My MongoDB ran in another container, so the values were &lt;code&gt;host.docker.internal:27017&lt;/code&gt;, &lt;code&gt;shop&lt;/code&gt;, &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;olake&lt;/code&gt; and &lt;code&gt;rs0&lt;/code&gt;, with &lt;strong&gt;Read Preference&lt;/strong&gt; left on &lt;code&gt;primary&lt;/code&gt;. For Atlas, enter one SRV host and turn &lt;strong&gt;Use SRV&lt;/strong&gt; on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqt8hfqwcuqxm7svfqfd8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqt8hfqwcuqxm7svfqfd8.webp" alt="OLake UI source form for MongoDB on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal:27017, database shop, auth DB admin, user olake, replica set rs0 and read preference primary" width="790" height="1130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. It tests the connection, confirms that a change stream can be opened and reports the oplog window before anything is saved. A single-node test container keeps a short oplog, so expect a warning here that does not block the sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Unity Catalog destination
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Destinations&lt;/strong&gt; and click &lt;strong&gt;Create Destination&lt;/strong&gt;. Pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector, &lt;strong&gt;Unity&lt;/strong&gt; as the catalog type and &lt;strong&gt;Personal Access Token&lt;/strong&gt; as the authentication type.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST Catalog URL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://&amp;lt;workspace-url&amp;gt;/api/2.1/unity-catalog/iceberg-rest&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unity Catalog Name&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;lakehouse&lt;/code&gt;, the catalog from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token&lt;/td&gt;
&lt;td&gt;the personal access token from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F775w8zxmz8oj1739bf1x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F775w8zxmz8oj1739bf1x.webp" alt="OLake UI destination form for an Apache Iceberg destination on the Unity catalog type, showing the personal access token fields" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. You never enter a bucket path, because Unity Catalog decides where the files go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. I named mine &lt;code&gt;mongodb_to_databricks&lt;/code&gt;. The schedule sets how often the change stream is drained, not how often a full copy runs.&lt;/li&gt;
&lt;li&gt;Select the MongoDB source and the Unity destination.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Databricks, plus DuckDB and Apache Spark if they will read the tables too.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;, and on the &lt;strong&gt;Streams&lt;/strong&gt; page tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;. Set the sync mode to &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and the ingestion mode to &lt;strong&gt;Upsert&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, then open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Item 3 is the one that matters for Databricks: under Unity Catalog it reads Iceberg v3 deletion vectors and rejects commits that carry equality deletes. With Databricks in the list, the &lt;strong&gt;Upsert Type&lt;/strong&gt; on both streams was already &lt;strong&gt;Deletion Vector&lt;/strong&gt;, so I had no format to choose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd4d77cpe58wuhyb9n4vx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd4d77cpe58wuhyb9n4vx.webp" alt="OLake UI Streams Selection page with the shop database, customers and orders selected, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Deletion Vector on Iceberg format version V3" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first sync copied 8 customers and 40 orders (48 documents, 6.40 KB) in &lt;strong&gt;23 seconds&lt;/strong&gt;, container start included. It opens the change stream and keeps the resume token first, then reads each collection in parallel chunks split on &lt;code&gt;_id&lt;/code&gt;. Whatever is written during the copy is replayed from that token afterwards, so there is no separate backfill job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fflgtbugsrc6ar43mznzw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fflgtbugsrc6ar43mznzw.webp" alt="OLake UI Job Logs and History for mongodb_to_databricks showing two completed syncs, the first in 23 seconds and the second in 16 seconds" width="798" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OLake Go names the schema after the job and the source database, so mine was &lt;code&gt;mongodb_to_databricks_shop&lt;/code&gt;. The &lt;strong&gt;Iceberg DB&lt;/strong&gt; field at the top of the Streams page changes that before the first sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the collections in Databricks
&lt;/h2&gt;

&lt;p&gt;There is nothing to register and nothing to refresh. The SQL editor or a notebook reads the tables by their three-part name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_databricks_shop&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;lakehouse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_databricks_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n, round(sum(CAST(amount AS DOUBLE)), 2) AS total
FROM lakehouse.mongodb_to_databricks_shop.orders
GROUP BY status ORDER BY status;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two MongoDB details show in these queries. The key column keeps its document name, &lt;code&gt;_id&lt;/code&gt;. And &lt;code&gt;amount&lt;/code&gt; is a &lt;code&gt;STRING&lt;/code&gt; because the source stores it as &lt;code&gt;Decimal128&lt;/code&gt;, which is why the roll-up casts before it sums.&lt;/p&gt;

&lt;p&gt;A 2X-Small serverless SQL warehouse was enough for my checks. Next to your own fields, OLake Go adds &lt;code&gt;_olake_id&lt;/code&gt; (a hash of the primary key), &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt;, &lt;code&gt;_cdc_timestamp&lt;/code&gt; and, for MongoDB, &lt;code&gt;_cdc_resume_token&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change documents in MongoDB and sync again
&lt;/h2&gt;

&lt;p&gt;A snapshot alone proves little, so I made 12 changes after the first sync: 7 inserts and 5 updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1299.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'25.50'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'349.99'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'89.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'79.90'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 change events (1.60 KB)&lt;/strong&gt; from the stream and finished in &lt;strong&gt;16 seconds&lt;/strong&gt; end to end.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;customers&lt;/code&gt;, that produced one new data file with 4 rows: the 2 inserts plus the new versions of the 2 updated documents. One deletion vector, a small bitmap per data file that marks replaced positions, retires the 2 old versions. The commit report in the sync log shows the same thing: &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedDVs=1&lt;/code&gt; and &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjn2w8wh5xzogssxs6oh0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjn2w8wh5xzogssxs6oh0.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for customers and orders after the change sync, showing addedDataFiles 1, addedDVs 1, addedRecords 4 and 8, and addedPositionalDeletes 2 and 3" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;orders&lt;/code&gt; table has the same shape, with 8 rows and 3 deleted positions, and the equality delete count stays at 0.&lt;/p&gt;

&lt;p&gt;Run the &lt;code&gt;SELECT&lt;/code&gt; from step 6 again. Databricks shows the new state on the next query: Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali has moved to Abu Dhabi, and the two new customers are listed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fectt4ywfgujm3do953pz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fectt4ywfgujm3do953pz.webp" alt="Databricks SQL editor running SELECT on datazip.mongodb_to_databricks_shop.customers on the 2X-Small SQL warehouse, returning 10 rows with id, name, city and tier" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;_op_type&lt;/code&gt; to the query to see how each row arrived: &lt;code&gt;r&lt;/code&gt; for snapshot rows, &lt;code&gt;c&lt;/code&gt; for the inserts and &lt;code&gt;u&lt;/code&gt; for the updates. The &lt;code&gt;orders&lt;/code&gt; roll-up matched MongoDB to the cent once &lt;code&gt;amount&lt;/code&gt; was cast. It gave 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema changes.&lt;/strong&gt; MongoDB has no schema, so a new field can appear in any document. OLake Go adds a column for a new top-level field on the next sync, and documents without the field hold &lt;code&gt;NULL&lt;/code&gt;. A field whose type changes between documents is widened to &lt;code&gt;STRING&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB and Spark
&lt;/h2&gt;

&lt;p&gt;No export or second copy is involved here. DuckDB attaches the Unity Catalog catalog as an Iceberg REST catalog with the same token, and Unity Catalog hands it short-lived storage credentials per table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;unity&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;personal access token&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'lakehouse'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;uc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://&amp;lt;workspace-url&amp;gt;/api/2.1/unity-catalog/iceberg-rest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;unity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'vended_credentials'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;uc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_databricks_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers and the same &lt;code&gt;orders&lt;/code&gt; roll-up as Databricks. DuckDB reads Iceberg v3 deletion vectors from duckdb-iceberg 1.5.3, and the principal behind the token needs &lt;code&gt;EXTERNAL USE SCHEMA&lt;/code&gt;, the same as OLake Go.&lt;/p&gt;

&lt;p&gt;Open source Spark reaches the catalog as a plain Iceberg REST catalog, with the catalog name as the &lt;code&gt;warehouse&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spark-sql \
  --packages org.apache.iceberg:iceberg-spark-runtime-4.0_2.13:1.10.0,org.apache.iceberg:iceberg-gcp-bundle:1.10.0 \
  --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
  --conf spark.sql.catalog.uc=org.apache.iceberg.spark.SparkCatalog \
  --conf spark.sql.catalog.uc.type=rest \
  --conf spark.sql.catalog.uc.uri=https://&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;workspace-url&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/api/2.1/unity-catalog/iceberg-rest \
  --conf spark.sql.catalog.uc.warehouse=lakehouse \
  --conf spark.sql.catalog.uc.token=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;personal access token&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; \
  --conf spark.sql.catalog.uc.header.X-Iceberg-Access-Delegation=vended-credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spark 4.0.1 with Iceberg 1.10.0 returned the same rows as the other two engines. Swap &lt;code&gt;iceberg-gcp-bundle&lt;/code&gt; for &lt;code&gt;iceberg-aws-bundle&lt;/code&gt; or &lt;code&gt;iceberg-azure-bundle&lt;/code&gt; to match the cloud your workspace runs on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data types to check before you query
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MongoDB&lt;/th&gt;
&lt;th&gt;Databricks shows&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;timestamp&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;INT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the integer &lt;code&gt;_id&lt;/code&gt; and &lt;code&gt;customer_id&lt;/code&gt; fields arrived as &lt;code&gt;INT&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;long&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BIGINT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;double&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DOUBLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BOOLEAN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIMESTAMP&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;written in Coordinated Universal Time (UTC)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;decimal128&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;STRING&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;cast before you sum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;objectId&lt;/code&gt;, &lt;code&gt;binData&lt;/code&gt;, &lt;code&gt;regex&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;STRING&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an &lt;code&gt;ObjectId&lt;/code&gt; key arrives as its 24-character hex string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;object&lt;/code&gt;, &lt;code&gt;array&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;STRING&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;JSON text; parse it at query time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Databricks column comes from &lt;code&gt;DESCRIBE&lt;/code&gt; on the tables of my run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips and limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cast Decimal128 before arithmetic.&lt;/strong&gt; &lt;code&gt;CAST(amount AS DOUBLE)&lt;/code&gt; worked for my roll-up, and &lt;code&gt;DECIMAL(12,2)&lt;/code&gt; gives exact arithmetic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flattening stops at one level.&lt;/strong&gt; Nested objects and arrays arrive as JSON text in a &lt;code&gt;STRING&lt;/code&gt; column. If every query would start by parsing that text, a landing table built for semi-structured data may serve you better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotate the token.&lt;/strong&gt; An expired personal access token fails the next sync at the first catalog call. Use a service principal with OAuth machine-to-machine credentials for production jobs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;These are Iceberg tables, not Delta tables.&lt;/strong&gt; If a pipeline needs native Delta Lake features on these rows, load them into a Delta table downstream.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check predictive optimization.&lt;/strong&gt; Unity Catalog runs snapshot expiration and file compaction on managed Iceberg tables when it is on (&lt;a href="https://docs.databricks.com/gcp/en/iceberg/" rel="noopener noreferrer"&gt;Databricks: Iceberg tables&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness is a schedule,&lt;/strong&gt; down to one minute, not a continuous stream.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  MongoDB to Databricks, three ways, side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mongoexport&lt;/code&gt; to a bucket, then COPY INTO or Auto Loader&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no; full reloads or your own merge&lt;/td&gt;
&lt;td&gt;tables written by a Databricks job&lt;/td&gt;
&lt;td&gt;an export script, a bucket and a Databricks job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka and Structured Streaming&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with your own merge logic&lt;/td&gt;
&lt;td&gt;Kafka topics, then tables written by a Databricks streaming job&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium and a running Databricks job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into Unity Catalog (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;yes, as deletion vectors&lt;/td&gt;
&lt;td&gt;Iceberg tables that Databricks, DuckDB and Spark all read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source; your storage and your own compute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Debezium fits when you need seconds of latency and already run Kafka. Writing open tables once pays off as soon as a second engine needs the same rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does OLake Go need a Databricks warehouse or cluster to write?
&lt;/h3&gt;

&lt;p&gt;No. It runs wherever you run Docker and writes the files itself, so Databricks compute is spent only when you query. Storage is the cloud bucket behind the catalog's managed location, billed at your cloud's storage rates.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens when a document is deleted in MongoDB?
&lt;/h3&gt;

&lt;p&gt;The next sync reads the delete from the change stream, and &lt;code&gt;_op_type&lt;/code&gt; uses &lt;code&gt;d&lt;/code&gt; for a delete. Like an update, it retires the old row with a deletion vector, not with an equality delete. My run only made inserts and updates, so I have no delete numbers to report.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long can the job stay paused?
&lt;/h3&gt;

&lt;p&gt;No longer than the oplog window. Each sync resumes from the token the previous one saved, and a token that has rolled out of the oplog means a fresh snapshot. Raise the window with &lt;code&gt;replSetResizeOplog&lt;/code&gt; on a self-hosted server, or with the minimum oplog window setting on Atlas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own collections. On Atlas, the source form takes one SRV host.&lt;/li&gt;
&lt;li&gt;The command line setup, the troubleshooting list and the full type mapping are in the &lt;a href="https://olake.io/docs/integrations/mongodb-to-databricks/" rel="noopener noreferrer"&gt;MongoDB to Databricks guide on olake.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your run prints something this post does not cover, paste the message in the comments and I will add it.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>databricks</category>
    </item>
    <item>
      <title>MongoDB to Snowflake with Change Streams: A Hands-On Tutorial Without Kafka</title>
      <dc:creator>Shubham Baldava</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:59:45 +0000</pubDate>
      <link>https://dev.to/shubham_olake/mongodb-to-snowflake-with-change-streams-a-hands-on-tutorial-without-kafka-501b</link>
      <guid>https://dev.to/shubham_olake/mongodb-to-snowflake-with-change-streams-a-hands-on-tutorial-without-kafka-501b</guid>
      <description>&lt;p&gt;A MongoDB to Snowflake pipeline usually starts as a script: &lt;code&gt;mongoexport&lt;/code&gt; a collection to JSON, load the file, repeat tomorrow. It holds up until someone asks why a cancelled order is still in the warehouse. Documents are updated and deleted in place, and an export sees none of that as a change.&lt;/p&gt;

&lt;p&gt;The usual ways to move MongoDB data into Snowflake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manual export:&lt;/strong&gt; &lt;code&gt;mongoexport&lt;/code&gt; to JSON, then &lt;code&gt;COPY INTO&lt;/code&gt; a VARIANT column. You run a script and a scheduler, freshness is hours to daily, and every run is a full reload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debezium, Kafka and the Snowflake Kafka connector:&lt;/strong&gt; changes arrive within seconds, and deletes depend on the connector's tombstone handling. You operate Kafka, Kafka Connect, Debezium and a schema registry to get there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed extract, load, transform (ELT) tools such as Fivetran, Estuary or Airbyte Cloud:&lt;/strong&gt; nothing to host and freshness in minutes, depending on the plan. They are priced per row, per GB or per connector, and the result is a second copy inside Snowflake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/connectors/mongodb/about" rel="noopener noreferrer"&gt;Snowflake Openflow connector for MongoDB&lt;/a&gt;:&lt;/strong&gt; Snowflake's own change stream reader. It lands native tables with the documents as VARIANT, runs as an Openflow deployment billed in Snowflake credits, and suits setups where Snowflake is the only reader.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial builds a fifth one. &lt;a href="https://github.com/datazip-inc/olake" rel="noopener noreferrer"&gt;OLake Go&lt;/a&gt;, an open source (Apache 2.0) replication tool, reads MongoDB change streams with change data capture (CDC) and commits each collection as an Apache Iceberg table into Horizon, the catalog built into every Snowflake account. Snowflake manages those tables as its own, with one column per top-level field, and DuckDB or Spark can read the same files.&lt;/p&gt;

&lt;p&gt;I ran it against MongoDB 7 as a single-node replica set and a Snowflake account on AWS (&lt;code&gt;ap-south-1&lt;/code&gt;), with OLake Go v1.1.0. The first sync copied 48 documents in 30 seconds, and the second replayed 12 changes in 15 seconds. All figures below come from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll build
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; a MongoDB database named &lt;code&gt;shop&lt;/code&gt; with two collections, &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline:&lt;/strong&gt; OLake UI from its Docker Compose install, with one job that copies the collections and then follows the change stream&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; Snowflake-managed tables in a database named &lt;code&gt;OLAKE_DEMO&lt;/code&gt;, queried in Snowsight&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You need:&lt;/strong&gt; MongoDB 4.0 or later running as a replica set (self-hosted or Atlas), Docker, a Snowflake account where you can run a one-time setup as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;, and about 30 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Run MongoDB as a replica set and create a user
&lt;/h2&gt;

&lt;p&gt;Change streams are built on the replica set oplog, so a standalone &lt;code&gt;mongod&lt;/code&gt; cannot serve them. A single node is enough. Start &lt;code&gt;mongod&lt;/code&gt; with &lt;code&gt;--replSet rs0&lt;/code&gt;, then run this in &lt;code&gt;mongosh&lt;/code&gt; on the primary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A single-node replica set (self-hosted only; Atlas clusters already are replica sets)&lt;/span&gt;
&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rs0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;host&amp;gt;:27017"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// The user OLake Go connects as&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"olake"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"shop"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"clusterMonitor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// The oplog size in bytes; raise it with replSetResizeOplog if it is small&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oplog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxSize&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;read&lt;/code&gt; role covers the first copy of the collections. &lt;code&gt;clusterMonitor&lt;/code&gt; (or &lt;code&gt;readAnyDatabase&lt;/code&gt;) is what grants the oplog access a change stream needs.&lt;/p&gt;

&lt;p&gt;Check both before moving on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stateStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// one PRIMARY&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSiblingDB&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the data. This seed recreates the two collections from my run, 8 customers and 40 orders, with money stored as &lt;code&gt;NumberDecimal&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;shop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Aarav Mehta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'aarav'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mumbai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Priya Sharma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'priya'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Bengaluru'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'liam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Austin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Sofia Rossi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'sofia'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Milan'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Kenji Tanaka'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'kenji'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Tokyo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Emma Schulz'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'emma'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Berlin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Noah Kim'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'noah'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Seoul'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'zara'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Dubai'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;'@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Headphones'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'shipped'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;7919&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;120000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Atlas the replica set and the oplog already exist. Create the user under &lt;strong&gt;Database Access&lt;/strong&gt; with the &lt;code&gt;read&lt;/code&gt; role on your database plus &lt;code&gt;clusterMonitor&lt;/code&gt;, and allow OLake Go's IP under &lt;strong&gt;Network Access&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The oplog is the replay window. Atlas and most self-hosted installs keep 24 hours or less by default, and OLake Go warns when the window is below 7 days. If the saved position rolls out of the oplog between two syncs, the job cannot resume and needs a fresh snapshot.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Prepare Snowflake
&lt;/h2&gt;

&lt;p&gt;Run this once in a Snowsight worksheet as &lt;code&gt;ACCOUNTADMIN&lt;/code&gt;. It creates the database the collections land in, a role and a service user for OLake Go, a network policy, and the token OLake Go signs in with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;ACCOUNTADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;XSMALL&lt;/span&gt; &lt;span class="no"&gt;AUTO_SUSPEND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="no"&gt;AUTO_RESUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;CATALOG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;EXTERNAL_VOLUME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SNOWFLAKE_MANAGED'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="no"&gt;WAREHOUSE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_WH&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;SYSADMIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SERVICE&lt;/span&gt; &lt;span class="no"&gt;DEFAULT_ROLE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="no"&gt;OLAKE_ROLE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Snowflake issues a token to a service user only under a network policy.&lt;/span&gt;
&lt;span class="no"&gt;USE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PUBLIC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;RULE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_ip&lt;/span&gt;
  &lt;span class="no"&gt;MODE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;INGRESS&lt;/span&gt; &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;IPV4&lt;/span&gt; &lt;span class="no"&gt;VALUE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;OLake Go egress IP&amp;gt;/32'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;NETWORK&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;
  &lt;span class="no"&gt;ALLOWED_NETWORK_RULE_LIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'OLAKE_DEMO.PUBLIC.olake_ip'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="no"&gt;NETWORK_POLICY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;olake_network_policy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ORGANIZATION_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'-'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="no"&gt;CURRENT_ACCOUNT_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;account_identifier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="no"&gt;CURRENT_REGION&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;region&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="no"&gt;USER&lt;/span&gt; &lt;span class="no"&gt;OLAKE_SVC&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="no"&gt;PROGRAMMATIC&lt;/span&gt; &lt;span class="no"&gt;ACCESS&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="no"&gt;OLAKE_PAT&lt;/span&gt;
  &lt;span class="no"&gt;ROLE_RESTRICTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_ROLE'&lt;/span&gt; &lt;span class="no"&gt;DAYS_TO_EXPIRY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a laptop the egress IP is your public IP, which &lt;code&gt;curl -s https://checkip.amazonaws.com&lt;/code&gt; prints. Save the &lt;code&gt;account_identifier&lt;/code&gt;, the &lt;code&gt;region&lt;/code&gt; and the token secret from the last statement, because Snowflake shows the secret once.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The network policy has to exist before the token. Without it the last statement fails with &lt;code&gt;Network Policy is required when creating a programmatic access token for user OLAKE_SVC&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The two &lt;code&gt;ALTER DATABASE&lt;/code&gt; lines are why there is nothing to create later. They turn every table OLake Go writes into a Snowflake-managed table on Snowflake's own storage, so you need no S3 bucket, identity and access management (IAM) role or external volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Start OLake UI and add the MongoDB source
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml &lt;span class="o"&gt;|&lt;/span&gt; docker compose -f - up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:8000&lt;/code&gt; and sign in with &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;Sources&lt;/strong&gt;, click &lt;strong&gt;Create Source&lt;/strong&gt; and pick &lt;strong&gt;MongoDB&lt;/strong&gt;. Under &lt;strong&gt;Change data capture (CDC)&lt;/strong&gt; leave &lt;strong&gt;Enable CDC&lt;/strong&gt; on.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Connection details&lt;/strong&gt;, add the host as &lt;code&gt;host:port&lt;/code&gt;, then the &lt;strong&gt;Database Name&lt;/strong&gt;, &lt;strong&gt;Auth DB&lt;/strong&gt;, username, password and &lt;strong&gt;Replica Set&lt;/strong&gt;. My MongoDB ran in another container, so the values were &lt;code&gt;host.docker.internal:27017&lt;/code&gt;, &lt;code&gt;shop&lt;/code&gt;, &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;olake&lt;/code&gt; and &lt;code&gt;rs0&lt;/code&gt;. &lt;strong&gt;Read Preference&lt;/strong&gt; stayed on &lt;code&gt;primary&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw51qy16ptcp1wu2ctnvn.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw51qy16ptcp1wu2ctnvn.webp" alt="OLake UI source form for MongoDB on OLake Go v1.1.0 with Enable CDC on, host host.docker.internal:27017, database shop, auth DB admin, user olake, replica set rs0 and read preference primary" width="790" height="1130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Set up source&lt;/strong&gt;. It tests the connection, confirms a change stream can be opened and reports the oplog window before anything is saved. My single-node container kept only 1.3 hours of oplog, so I got a warning here: fine for a demo, not for production.&lt;/p&gt;

&lt;p&gt;For Atlas, enter one SRV host and switch &lt;strong&gt;Use SRV&lt;/strong&gt; on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add the Snowflake destination
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Destinations&lt;/strong&gt; and click &lt;strong&gt;Create Destination&lt;/strong&gt;. Pick &lt;strong&gt;Apache Iceberg&lt;/strong&gt; as the connector, &lt;strong&gt;Horizon&lt;/strong&gt; as the catalog type and &lt;strong&gt;Programmatic Access Token (PAT)&lt;/strong&gt; as the authentication type.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Horizon Iceberg REST Catalog URI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake Database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;OLAKE_DEMO&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Programmatic Access Token&lt;/td&gt;
&lt;td&gt;the secret from step 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session Role Scope&lt;/td&gt;
&lt;td&gt;&lt;code&gt;session:role:OLAKE_ROLE&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud Storage Region&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;region&lt;/code&gt; value from step 2, &lt;code&gt;AWS_AP_SOUTH_1&lt;/code&gt; in my run&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv5i30xbcdw3jj64vb4z.webp" alt="OLake UI destination form for the Snowflake Horizon catalog showing the programmatic access token authentication fields" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;. OLake Go calls the Horizon endpoint and exchanges the token before it saves the destination, so a wrong scope or a blocked IP surfaces at this point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create the job and run the first sync
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Jobs&lt;/strong&gt; and click &lt;strong&gt;Create Job&lt;/strong&gt;. I named the job &lt;code&gt;mongodb_to_snowflake&lt;/code&gt; and gave it a schedule. The schedule decides how often the change stream is drained, not how often a full copy runs.&lt;/p&gt;

&lt;p&gt;Select the source and the destination. Under &lt;strong&gt;Advanced Settings&lt;/strong&gt;, set &lt;strong&gt;Target Query Engines&lt;/strong&gt; to Snowflake, plus DuckDB and Apache Spark if they will read the tables too. I set all three, and that is the only format choice in the setup: OLake Go resolves an Iceberg delete format that every listed engine can read.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;. On the &lt;strong&gt;Streams&lt;/strong&gt; page tick &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, set the sync mode to &lt;strong&gt;Full Refresh + CDC&lt;/strong&gt; and the ingestion mode to &lt;strong&gt;Upsert&lt;/strong&gt;. Leave &lt;strong&gt;Upsert Type&lt;/strong&gt; as resolved, which was &lt;strong&gt;Positional Deletes&lt;/strong&gt; in my run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwyosgbsmhsbrpqjnimqr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwyosgbsmhsbrpqjnimqr.webp" alt="OLake UI Streams page with the shop database, customers and orders selected, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Positional Deletes" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create Job&lt;/strong&gt;, open the job's menu and choose &lt;strong&gt;Sync Now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The first sync copied 8 customers and 40 orders in &lt;strong&gt;30 seconds&lt;/strong&gt;, container start included. It opens the change stream and keeps its resume token first, then reads each collection in parallel chunks split on &lt;code&gt;_id&lt;/code&gt;. Anything written during the copy is replayed afterwards from that token, so there is no separate backfill job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7xv1unggn61swn6edu6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7xv1unggn61swn6edu6.webp" alt="OLake UI job history for mongodb_to_snowflake with two completed syncs, the first in 30 seconds and the second in 15 seconds" width="800" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Query the collections in Snowsight
&lt;/h2&gt;

&lt;p&gt;No &lt;code&gt;CREATE ICEBERG TABLE&lt;/code&gt; and no refresh are needed. OLake Go names the schema after the job and the source database, so mine is &lt;code&gt;mongodb_to_snowflake_shop&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;SHOW&lt;/span&gt; &lt;span class="no"&gt;ICEBERG&lt;/span&gt; &lt;span class="no"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"mongodb_to_snowflake_shop"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="s2"&gt;"_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"city"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tier"&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;OLAKE_DEMO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"mongodb_to_snowflake_shop"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;"customers"&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s2"&gt;"_id"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw22oqbxx7q7r06kvwul5.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw22oqbxx7q7r06kvwul5.webp" alt="Snowsight running SHOW ICEBERG TABLES on mongodb_to_snowflake_shop and listing customers and orders with owner OLAKE_ROLE, external volume SNOWFLAKE_MANAGED and table type MANAGED" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SHOW ICEBERG TABLES&lt;/code&gt; reports &lt;code&gt;iceberg_table_type = MANAGED&lt;/code&gt; and &lt;code&gt;external_volume_name = SNOWFLAKE_MANAGED&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Keep the double quotes. The schema and tables carry their lowercase MongoDB names, and Snowflake upper-cases anything unquoted. Drop the quotes and you get &lt;code&gt;Object 'OLAKE_DEMO.MONGODB_TO_SNOWFLAKE_SHOP.CUSTOMERS' does not exist or not authorized.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The primary key column is &lt;code&gt;_id&lt;/code&gt;, exactly as in the documents. Next to your own fields sit &lt;code&gt;_olake_id&lt;/code&gt;, &lt;code&gt;_op_type&lt;/code&gt;, &lt;code&gt;_olake_timestamp&lt;/code&gt;, &lt;code&gt;_cdc_timestamp&lt;/code&gt; and, for MongoDB, &lt;code&gt;_cdc_resume_token&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Change documents in MongoDB and sync again
&lt;/h2&gt;

&lt;p&gt;This is the part an export script cannot do. Make 12 changes, 7 inserts and 5 updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Maya Patel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maya@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Pune'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'silver'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Lucas Silva'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'lucas@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'São Paulo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'bronze'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Laptop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1299.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'25.50'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Monitor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'349.99'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'89.00'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NumberDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'79.90'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'placed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Liam Carter'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'gold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Zara Ali'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Abu Dhabi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$in&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'delivered'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;strong&gt;Sync Now&lt;/strong&gt; again. The second sync read &lt;strong&gt;12 change events (1.60 KB)&lt;/strong&gt; from the stream and finished in &lt;strong&gt;15 seconds&lt;/strong&gt;. For &lt;code&gt;customers&lt;/code&gt; it wrote one data file with 4 rows, the 2 inserts plus the new versions of the 2 updated documents, and one small delete file that retires the 2 old versions.&lt;/p&gt;

&lt;p&gt;The commit report in the sync log says the same thing: &lt;code&gt;addedDataFiles=1&lt;/code&gt;, &lt;code&gt;addedRecords=4&lt;/code&gt;, &lt;code&gt;addedPositionalDeleteFiles=1&lt;/code&gt;, &lt;code&gt;addedPositionalDeletes=2&lt;/code&gt;. &lt;code&gt;orders&lt;/code&gt; has the same shape with 8 rows and 3 deletes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftmh1v3ipu5jcof8azfhi.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftmh1v3ipu5jcof8azfhi.webp" alt="OLake UI sync log filtered to the Iceberg commit reports for orders and customers, showing one added data file and one positional delete file each and zero equality deletes" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Re-run the &lt;code&gt;SELECT&lt;/code&gt; with &lt;code&gt;"_op_type"&lt;/code&gt; added. Liam Carter is &lt;code&gt;gold&lt;/code&gt;, Zara Ali is in Abu Dhabi, and the column shows &lt;code&gt;r&lt;/code&gt; for snapshot rows, &lt;code&gt;u&lt;/code&gt; for the two updates and &lt;code&gt;c&lt;/code&gt; for the two inserts. A delete arrives as &lt;code&gt;d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzt0l542etz5kdhvdpdlt.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzt0l542etz5kdhvdpdlt.webp" alt="Snowsight query on customers after the change sync returning 10 rows, with _op_type r for snapshot rows, u for Liam Carter and Zara Ali, and c for Maya Patel and Lucas Silva" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Schema changes.&lt;/strong&gt; MongoDB has no schema, so a new field can show up in any document. OLake Go adds a column for a new top-level field on the next sync, and documents without it hold &lt;code&gt;NULL&lt;/code&gt;. A field whose type differs between documents, a number in one and a string in another, is widened to &lt;code&gt;VARCHAR&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the same tables from DuckDB
&lt;/h2&gt;

&lt;p&gt;Nothing is exported or copied for this. DuckDB reads the files OLake Go wrote, through the same Horizon endpoint, with storage credentials vended by Snowflake. It wants a bearer token instead of the raw access token, so exchange it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -X POST &lt;span class="s2"&gt;"https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/x-www-form-urlencoded'&lt;/span&gt; \
  --data-urlencode &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client_credentials \
  --data-urlencode &lt;span class="nv"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;session:role:OLAKE_ROLE \
  --data-urlencode &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;your PAT&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;INSTALL&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="n"&gt;httpfs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;access_token from /v1/oauth/tokens&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;ATTACH&lt;/span&gt; &lt;span class="s1"&gt;'OLAKE_DEMO'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="no"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;iceberg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ENDPOINT&lt;/span&gt; &lt;span class="s1"&gt;'https://&amp;lt;account_identifier&amp;gt;.snowflakecomputing.com/polaris/api/catalog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;SECRET&lt;/span&gt; &lt;span class="n"&gt;horizon_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;ACCESS_DELEGATION_MODE&lt;/span&gt; &lt;span class="s1"&gt;'vended_credentials'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;horizon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mongodb_to_snowflake_shop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5b4yuj6r1vzcsxdekv6.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5b4yuj6r1vzcsxdekv6.webp" alt="DuckDB 1.5.5 shell querying horizon.mongodb_to_snowflake_shop.customers and returning the same 10 rows as Snowflake" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DuckDB 1.5.5 returned the same 10 customers as Snowflake, and so did Spark 3.5.6 with Iceberg 1.10.0. An &lt;code&gt;orders&lt;/code&gt; roll-up by status matched MongoDB to the cent in all three engines: 16 delivered orders for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25. In Snowflake that roll-up uses &lt;code&gt;SUM("amount"::NUMBER(10,2))&lt;/code&gt;, because the money field arrives as text.&lt;/p&gt;

&lt;p&gt;The session token lives about an hour. The network policy from step 2 covers every use of the token, so DuckDB has to connect from an allowed IP too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data types worth knowing
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MongoDB&lt;/th&gt;
&lt;th&gt;Snowflake shows&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;timestamp&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUMBER(10,0)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;long&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;NUMBER(19,0)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;double&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FLOAT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BOOLEAN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TIMESTAMP_LTZ(6)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;UTC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;decimal128&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VARCHAR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;cast before you sum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;objectId&lt;/code&gt;, &lt;code&gt;binData&lt;/code&gt;, &lt;code&gt;regex&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VARCHAR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an &lt;code&gt;ObjectId&lt;/code&gt; key arrives as its 24-character hex string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;object&lt;/code&gt;, &lt;code&gt;array&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VARCHAR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;JSON text; parse with &lt;code&gt;PARSE_JSON()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Snowflake column follows Snowflake's &lt;a href="https://docs.snowflake.com/en/user-guide/tables-iceberg-data-types" rel="noopener noreferrer"&gt;Iceberg data types&lt;/a&gt; page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips and limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cast Decimal128 before arithmetic.&lt;/strong&gt; Money stored as &lt;code&gt;NumberDecimal&lt;/code&gt; lands as text. Store doubles in MongoDB if you want a numeric column without the cast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flattening goes one level deep.&lt;/strong&gt; Nested objects and arrays arrive as JSON text in one column. If every query would start with &lt;code&gt;PARSE_JSON&lt;/code&gt;, a VARIANT landing table in Snowflake may serve you better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size the oplog for your longest pause.&lt;/strong&gt; Use &lt;code&gt;replSetResizeOplog&lt;/code&gt; on self-hosted MongoDB, or the minimum oplog window setting on Atlas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put token renewal on a calendar.&lt;/strong&gt; The token above expires after 30 days, and 365 is the maximum. An expired token fails the next sync at the catalog handshake, before any data moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness is a schedule,&lt;/strong&gt; down to one minute. This is not sub-second streaming.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DuckDB cannot be the second reader on an Azure Snowflake account.&lt;/strong&gt; It attaches REST catalogs backed by S3, S3 Tables or Google Cloud Storage only, so use Spark or Trino there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small files add up.&lt;/strong&gt; Snowflake expires old snapshots and compacts manifests on managed tables, but a table that gets a new small file every minute wants data-file compaction from the writer side. Spark's &lt;code&gt;rewrite_data_files&lt;/code&gt; works through the same Horizon endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How the MongoDB to Snowflake methods compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Updates and deletes&lt;/th&gt;
&lt;th&gt;Where the data lands&lt;/th&gt;
&lt;th&gt;What you run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;mongoexport&lt;/code&gt; to JSON, then &lt;code&gt;COPY INTO&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;hours to daily&lt;/td&gt;
&lt;td&gt;no, full reloads only&lt;/td&gt;
&lt;td&gt;files you control&lt;/td&gt;
&lt;td&gt;a script and a scheduler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debezium, Kafka, Snowflake Kafka connector&lt;/td&gt;
&lt;td&gt;seconds&lt;/td&gt;
&lt;td&gt;yes, with tombstone handling&lt;/td&gt;
&lt;td&gt;Kafka topics, then Snowflake tables&lt;/td&gt;
&lt;td&gt;Kafka, Kafka Connect, Debezium, a schema registry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fivetran, Estuary, Airbyte Cloud&lt;/td&gt;
&lt;td&gt;minutes, by plan&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Snowflake tables, as a second copy&lt;/td&gt;
&lt;td&gt;nothing; per row, per GB or per connector pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake Openflow connector for MongoDB&lt;/td&gt;
&lt;td&gt;CDC through change streams&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;native Snowflake tables, documents as VARIANT&lt;/td&gt;
&lt;td&gt;an Openflow deployment, billed in Snowflake credits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OLake Go into Horizon (this post)&lt;/td&gt;
&lt;td&gt;CDC on a schedule down to one minute&lt;/td&gt;
&lt;td&gt;yes, as Iceberg row-level deletes&lt;/td&gt;
&lt;td&gt;Iceberg tables that Snowflake, DuckDB, Spark and Trino read&lt;/td&gt;
&lt;td&gt;one Docker Compose stack, open source&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When Snowflake is the only reader and you want Snowflake to run the pipeline, Openflow is the simpler choice. The route in this post makes sense once a second engine needs the same rows, or you want to own the files.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What happens when a new field appears in only some documents?
&lt;/h3&gt;

&lt;p&gt;OLake Go adds a column for that top-level field on the next sync, and Snowflake shows it without any action from you. Documents that lack the field hold &lt;code&gt;NULL&lt;/code&gt; in the new column.&lt;/p&gt;

&lt;h3&gt;
  
  
  My &lt;code&gt;_id&lt;/code&gt; is an ObjectId, not an integer. What shows up in Snowflake?
&lt;/h3&gt;

&lt;p&gt;The key column is still named &lt;code&gt;_id&lt;/code&gt;, and an &lt;code&gt;ObjectId&lt;/code&gt; arrives as its 24-character hex string in a &lt;code&gt;VARCHAR&lt;/code&gt; column. Quote it as &lt;code&gt;"_id"&lt;/code&gt; in Snowflake like every other name.&lt;/p&gt;

&lt;h3&gt;
  
  
  How far apart can two syncs be?
&lt;/h3&gt;

&lt;p&gt;As far as the oplog window allows. Each sync resumes the change stream from a token saved by the previous one, and if the oplog has rolled past that token the job needs a fresh snapshot. The source test shows the current window, which was 1.3 hours on my demo container.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the writer use a Snowflake warehouse?
&lt;/h3&gt;

&lt;p&gt;No. OLake Go runs wherever you run Docker and writes the files itself, so Snowflake compute is spent only when you query. Storage is billed at Snowflake storage rates for the Parquet and delete files, because the database uses &lt;code&gt;SNOWFLAKE_MANAGED&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point the source at your own collections. On Atlas the user and the network access are set in the Atlas console, and the source form takes one SRV host.&lt;/li&gt;
&lt;li&gt;Want the files in your own S3 bucket? Use AWS Glue as the catalog. Snowflake then reads the tables through a read-only catalog integration that you refresh after each sync, and Athena, Redshift and Amazon Elastic MapReduce (EMR) read them natively.&lt;/li&gt;
&lt;li&gt;Add Spark as a third reader. It takes the same access token, with the role passed as &lt;code&gt;scope&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The Glue setup, the Spark connection and the troubleshooting list are in the &lt;a href="https://olake.io/docs/integrations/mongodb-to-snowflake/" rel="noopener noreferrer"&gt;MongoDB to Snowflake guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a step behaves differently on your cluster, post the error text in the comments and I'll update the tutorial.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>snowflake</category>
    </item>
  </channel>
</rss>
