Skip to content

Fix delta external table schema diff, script syntax, and cleanup#164

Merged
ashleyvansp merged 3 commits intomainfrom
fix/delta-schema-perpetual-diff
Apr 13, 2026
Merged

Fix delta external table schema diff, script syntax, and cleanup#164
ashleyvansp merged 3 commits intomainfrom
fix/delta-schema-perpetual-diff

Conversation

@ashleyvansp
Copy link
Copy Markdown
Contributor

Fixes for delta external tables:

  1. Schema perpetual diff: The bulk loader populates the schema for all external tables from the cluster, but delta tables can auto-infer their schema from the delta, so YAML configs may intentionally omit it. This caused a perpetual diff on every run.
  2. Missing closing parenthesis in the CreateDeltaScript connection string
  3. Remove unnecessary dataFormat requirement because Delta tables don't use dataformat= in the Kusto command syntax.
  4. Only emit with() properties when set; Delta script no longer emits empty folder='', docString='', fileExtension='' when not specified in YAML.

Fixes github/data#11973

Three fixes for delta external tables:

1. Schema perpetual diff: The bulk loader populates the schema for all
   external tables from the cluster, but delta tables auto-infer their
   schema from the delta log — so YAML configs intentionally omit it.
   This caused a perpetual diff on every run. Fix: before comparing,
   clear the cluster-side schema for delta tables when the YAML doesn't
   specify one. If the YAML provides a custom schema, keep it for
   proper comparison.

2. Missing closing paren: CreateDeltaScript generated an unclosed
   parenthesis around the connection string, producing invalid KQL
   that fails Kusto syntax validation and cannot be applied.

3. Remove unnecessary dataFormat requirement: Delta tables don't use
   dataformat= in the Kusto command syntax. Removed the misleading
   validation that required it.

4. Only emit with() properties when set: Delta script no longer emits
   empty folder='', docString='', fileExtension='' when not specified
   in YAML. The with() block is omitted entirely if no properties are
   set.

Fixes github/data#11973

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 13, 2026 16:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes delta external table generation and diffing so YAML configs can intentionally omit schema without causing perpetual diffs, and corrects delta script syntax/output.

Changes:

  • Adjust delta external table script generation (fix connection-string parenthesis; emit with(...) only when properties are set; remove DataFormat requirement).
  • Suppress perpetual schema diffs for delta external tables by clearing cluster-side schema when YAML omits schema.
Show a summary per file
File Description
KustoSchemaTools/Model/ExternalTable.cs Updates delta external table KQL script emission (syntax + conditional with() properties).
KustoSchemaTools/Changes/DatabaseChanges.cs Adds delta-specific schema normalization to avoid phantom/perpetual diffs during comparison.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

@ashleyvansp ashleyvansp merged commit c5afb85 into main Apr 13, 2026
5 checks passed
@ashleyvansp ashleyvansp deleted the fix/delta-schema-perpetual-diff branch April 13, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants