<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Possible bug in Lakeflow Connect SQL Server ingestion with GUID primary keys – Missing records in Databricks Free Edition Help</title>
    <link>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173734#M992</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266919"&gt;@volodymyr_b&lt;/a&gt; — I think your theory is right, and your own log line backs it up.&lt;/P&gt;&lt;P&gt;SQL Server doesn’t sort uniqueidentifier the way the string sorts. It compares the &lt;STRONG&gt;last&lt;/STRONG&gt; 6-byte group first (the FFE14F608876 part), then works backward through the other groups. Look at the upper bound in your snapshot filter: 38C5A9C6-…-8A7F-FFE14F608876. That last group is close to the top of the range, which is exactly what you’d expect if the connector computed MAX(Id) using GUID ordering. But the predicate it applies is a &lt;STRONG&gt;string&lt;/STRONG&gt; comparison (RPAD(Id, 36, ' ') &amp;lt;= '38C5…'), so only IDs that start with roughly 0–38… make it through. With splitCount=1 and no “dropped” rows, the pipeline thinks it read everything.&lt;/P&gt;&lt;P&gt;You can confirm it on the source without changing anything:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;sql&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;SELECT
  MAX(Id)                         AS max_as_guid,
  MAX(CONVERT(char(36), Id))      AS max_as_string,
  SUM(CASE WHEN CONVERT(char(36), Id) &amp;lt;= '38C5A9C6-D111-4182-8A7F-FFE14F608876'
           THEN 1 ELSE 0 END)     AS rows_kept_by_string_filter
FROM dbo.YourTable;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;If max_as_guid matches the boundary in your log and rows_kept_by_string_filter comes back as 364, that proves it.&lt;/P&gt;&lt;P&gt;On workarounds: I’m not aware of a documented setting to change the split column for the SQL Server connector. Until it’s fixed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Treat it as a connector bug. If you have a paid workspace, open a support ticket with the query above and the log lines. That’s the fastest route to a fix.&lt;/LI&gt;&lt;LI&gt;Don’t trust the snapshot for GUID-keyed tables. A quick COUNT(*) check between source and target after each full refresh would catch it.&lt;/LI&gt;&lt;LI&gt;As a stopgap, pull the table through Lakehouse Federation or JDBC into a separate table and reconcile against that.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;A couple of questions that would help others reproduce it: are you using CDC or Change Tracking, and does a table with an INT/BIGINT key in the same pipeline come through complete?&lt;/P&gt;</description>
    <pubDate>Sat, 17 Oct 2026 21:29:57 GMT</pubDate>
    <dc:creator>ethan_parmer</dc:creator>
    <dc:date>2026-10-17T21:29:57Z</dc:date>
    <item>
      <title>Possible bug in Lakeflow Connect SQL Server ingestion with GUID primary keys – Missing records</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173596#M990</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We've encountered a strange issue with &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Databricks Lakeflow Connect query-based ingestion from SQL Server&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, and I'm wondering if anyone else has experienced something similar.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have a SQL Server table with 1,448 records and a &lt;/SPAN&gt;&lt;STRONG&gt;uniqueidentifier&lt;/STRONG&gt;&lt;SPAN&gt; primary key. When performing a full refresh, Databricks ingests only &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;364 records&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, but the pipeline completes successfully without any errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After digging into the cluster logs, I suspect the problem is related to &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;how Databricks handles GUID ordering during snapshot partitioning&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The connector correctly identifies 1,448 distinct IDs:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;-- logs&lt;BR /&gt;getSnapshotSplitsByNonNumericKey:
splitCount=1, totalDistinct=1448&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;However, the generated query applies the following filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;-- logs&lt;BR /&gt;Pushed Filters: Id IS NOT NULL, (RPAD(Id, 36, ' ')) &amp;lt;= '38C5A9C6-D111-4182-8A7F-FFE14F608876'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The snapshot then completes with:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;-- logs&lt;BR /&gt;numInputRows: 364
dropped: 0&lt;/SPAN&gt;&lt;/PRE&gt;&lt;H3&gt;&lt;SPAN&gt;What I think is happening&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;SPAN&gt;SQL Server compares &lt;/SPAN&gt;&lt;SPAN&gt;uniqueidentifier&lt;/SPAN&gt;&lt;SPAN&gt; values differently from their string representations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My theory is that Databricks:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Retrieves the GUIDs using SQL Server's &lt;STRONG&gt;native GUID ordering&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Determines the upper boundary for the snapshot partition.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Applies that boundary using a &lt;STRONG&gt;string comparison&lt;/STRONG&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;RPAD(Id, 36, ' ') &amp;lt;= ...&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Accidentally excludes records because string ordering and native GUID ordering are different.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;For example, consider these two GUIDs:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;38DE50FE-2AC8-46E8-91AB-EAB0A9E944B0
38C5A9C6-D111-4182-8A7F-FFE14F608876&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;You can reproduce the difference directly in SQL Server. Try this query:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;DECLARE @guid_a uniqueidentifier = '38DE50FE-2AC8-46E8-91AB-EAB0A9E944B0';
DECLARE @guid_b uniqueidentifier = '38C5A9C6-D111-4182-8A7F-FFE14F608876';

SELECT CASE WHEN @guid_a &amp;lt; @guid_b THEN 'TRUE' ELSE 'FALSE' END, 'GUID'
UNION
SELECT CASE WHEN CONVERT(char(36), @guid_a) &amp;lt; CONVERT(char(36), @guid_b) THEN 'TRUE' ELSE 'FALSE' END, 'STR';&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The result is:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;TRUE     GUID
FALSE    STR&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;So the &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;same two GUIDs produce opposite comparison results&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; depending on whether they are compared as native &lt;/SPAN&gt;&lt;SPAN&gt;uniqueidentifier&lt;/SPAN&gt;&lt;SPAN&gt; values or strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN&gt;My questions&lt;/SPAN&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Has anyone encountered this issue with Lakeflow Connect query-based ingestion?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to override the automatically selected snapshot partitioning column in the pipeline configuration?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;Are there any known workarounds that don't require modifying the source SQL Server tables?&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What concerns me most is that &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;the pipeline reports a successful full refresh despite missing a significant number of records&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;. This could easily go unnoticed and lead to silently incomplete datasets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any insights would be appreciated. Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2026 08:43:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173596#M990</guid>
      <dc:creator>volodymyr_b</dc:creator>
      <dc:date>2026-10-16T08:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in Lakeflow Connect SQL Server ingestion with GUID primary keys – Missing records</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173611#M991</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266919"&gt;@volodymyr_b&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The SQL Server connector &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-reference" target="_self"&gt;reference&lt;/A&gt; confirms that UNIQUEIDENTIFIER is automatically converted to STRING, which makes the ordering behaviour you've identified worth investigating.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I ran a few independent test using &lt;STRONG&gt;SQL Server&lt;/STRONG&gt;&amp;nbsp;and &lt;STRONG&gt;Databricks serverless&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Using the boundary &lt;STRONG&gt;38C5A9C6-D111-4182-8A7F-FFE14F608876&lt;/STRONG&gt;, I observed that GUID 38DE50FE-2AC8-46E8-91AB-EAB0A9E944B0 satisfies SQL Server's native UNIQUEIDENTIFIER comparison but is excluded when the same comparison is performed using its string representation.&lt;/P&gt;&lt;P&gt;To cross-check this, I ran the equivalent&lt;STRONG&gt; RPAD(Id, 36, ' ') &amp;lt;= boundary&lt;/STRONG&gt; filter in Databricks serverless and observed the same GUID being excluded.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then further&amp;nbsp;tested with a synthetic dataset of 1,000 deterministic, distinct GUIDs in SQL Server and ran the equivalent filter in Databricks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Using the boundary &lt;STRONG&gt;38C5A9C6-D111-4182-8A7F-FFE14F608876&lt;/STRONG&gt;, I observed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;SQL Server native UNIQUEIDENTIFIER comparison&lt;/STRONG&gt;: 1,000 rows matched&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;SQL Server string comparison&lt;/STRONG&gt;: 222 rows matched&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Databricks Spark RPAD(Id, 36, ' ') &amp;lt;= boundary&lt;/STRONG&gt;: 222 rows matched&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;So, for this dataset and boundary, 778 rows satisfy the native GUID comparison but are excluded by the string comparison.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;These confirms the ordering difference across both environments and lends further support to your hypothesis about a potential mismatch in the connector's snapshot partitioning logic.&amp;nbsp;&lt;SPAN&gt;Although this doesn't establish how Lakeflow internally calculates partition boundaries, it demonstrates the impact that inconsistent comparison could have.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regarding &lt;/SPAN&gt;&lt;SPAN&gt;question about&lt;STRONG&gt; overriding the snapshot partitioning column&lt;/STRONG&gt;, the query-based connector &lt;A href="https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/query-based-limits" target="_self"&gt;limitations&lt;/A&gt; mention that you can&lt;STRONG&gt; contact your Databricks account team to request a partitioning column&lt;/STRONG&gt; &lt;STRONG&gt;override&lt;/STRONG&gt; when the automatically selected column is unsuitable.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2026 12:05:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173611#M991</guid>
      <dc:creator>data_pulse</dc:creator>
      <dc:date>2026-10-16T12:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in Lakeflow Connect SQL Server ingestion with GUID primary keys – Missing records</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173734#M992</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266919"&gt;@volodymyr_b&lt;/a&gt; — I think your theory is right, and your own log line backs it up.&lt;/P&gt;&lt;P&gt;SQL Server doesn’t sort uniqueidentifier the way the string sorts. It compares the &lt;STRONG&gt;last&lt;/STRONG&gt; 6-byte group first (the FFE14F608876 part), then works backward through the other groups. Look at the upper bound in your snapshot filter: 38C5A9C6-…-8A7F-FFE14F608876. That last group is close to the top of the range, which is exactly what you’d expect if the connector computed MAX(Id) using GUID ordering. But the predicate it applies is a &lt;STRONG&gt;string&lt;/STRONG&gt; comparison (RPAD(Id, 36, ' ') &amp;lt;= '38C5…'), so only IDs that start with roughly 0–38… make it through. With splitCount=1 and no “dropped” rows, the pipeline thinks it read everything.&lt;/P&gt;&lt;P&gt;You can confirm it on the source without changing anything:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;sql&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;SELECT
  MAX(Id)                         AS max_as_guid,
  MAX(CONVERT(char(36), Id))      AS max_as_string,
  SUM(CASE WHEN CONVERT(char(36), Id) &amp;lt;= '38C5A9C6-D111-4182-8A7F-FFE14F608876'
           THEN 1 ELSE 0 END)     AS rows_kept_by_string_filter
FROM dbo.YourTable;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;If max_as_guid matches the boundary in your log and rows_kept_by_string_filter comes back as 364, that proves it.&lt;/P&gt;&lt;P&gt;On workarounds: I’m not aware of a documented setting to change the split column for the SQL Server connector. Until it’s fixed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Treat it as a connector bug. If you have a paid workspace, open a support ticket with the query above and the log lines. That’s the fastest route to a fix.&lt;/LI&gt;&lt;LI&gt;Don’t trust the snapshot for GUID-keyed tables. A quick COUNT(*) check between source and target after each full refresh would catch it.&lt;/LI&gt;&lt;LI&gt;As a stopgap, pull the table through Lakehouse Federation or JDBC into a separate table and reconcile against that.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;A couple of questions that would help others reproduce it: are you using CDC or Change Tracking, and does a table with an INT/BIGINT key in the same pipeline come through complete?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2026 21:29:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/possible-bug-in-lakeflow-connect-sql-server-ingestion-with-guid/m-p/173734#M992</guid>
      <dc:creator>ethan_parmer</dc:creator>
      <dc:date>2026-10-17T21:29:57Z</dc:date>
    </item>
  </channel>
</rss>

