Repository navigation
External orchestration for Microsoft Fabric (DIRECT 2.2.0) - #51
Merged
Merged
Conversation
New procedures omd.CreateBatchModuleInstances and omd.EndBatchModuleInstances open and close all instances of a Batch in one call each, so that an orchestrator outside the repository database can run the Module executables on another engine such as a Fabric Warehouse. omd.ModuleEvaluation can hand the rollback statement back to the caller (@ExecuteRollbackIndicator) and omd.GetConsistencyTimestamp can work from repository information only (@SourceDataLookupIndicator). New view omd_processing.vw_BATCH_HIERARCHY. The fabric folder holds the standard pipelines DIRECT Run Project, DIRECT Run Batch and DIRECT Run Module (Fabric Git item layout), a Variable Library definition, the activity scripts, and PowerShell scripts to build the definitions, deploy, run and schedule them. Release notes, documentation and integration tests are included; the version is bumped to 2.2.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
Resolves the SR0013 and SR0014 static analysis warnings reported by the dacpac build for the new and changed procedures. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
The safety net already adds brackets when the target has none; quoting the result again produced invalid names for schema-qualified targets such as [lnd].[LND_CUSTOMER] (found while testing the Fabric hand-off). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
… in the first pipeline run omd.CreateBatchModuleInstances gets @ReturnResultSet and the output parameter @ResultJson so the Open Batch Script activity no longer needs INSERT ... EXEC, which wrapped the call in a transaction that a failed evaluation dooms. A Batch evaluation that returns neither Proceed nor Abort or Cancel now fails the procedure instead of creating Module Instances. Fixed pre-existing issues: omd.BatchEvaluation built an invalid IN ((1,2)) list in the partial rollback branch; the post-deployment seed of omd.MODULE_INSTANCE merged on BATCH_INSTANCE_ID and overwrote every standalone Module Instance; omd.ModuleEvaluation doubled the parentheses around the Module Instance id list in the returned rollback statement. Two integration tests cover the JSON output and the run after two failed Batch Instances. The pipeline definitions are regenerated from the templates. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
…ets as deleted rows Run Modules used the current time as load window end when the source held no rows, so the recorded end value ran ahead of the data. An empty source now keeps the end at the start value; the current time remains the fallback for a source without the load window attribute. The row counts from the target counts before and after now report a target with fewer rows than before (a truncate-and-load table) as deleted and reloaded instead of a negative insert count. Close Module passes RowCountDeleted along. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
omd.CreateBatchModuleInstances gets @IncludeChildBatches: after the Modules of the Batch it opens the active child Batches recursively and in sequence, each with its parent Batch Instance, in the order omd.RunBatch uses. The new output parameter @BatchInstancesJson lists the Batch Instances that were created. A Batch that cannot be fully opened now fails the Module and Batch Instances it did open. omd.EndBatchModuleInstances gets the same option and the output parameter @FailedBatchCount: Module Instances of child Batch Instances are accepted, unreported ones are failed, and the child Batch Instances are closed from the deepest level up before the Batch Instance itself. A failed Module or child Batch Instance fails its Batch Instance; a child that aborted in its evaluation does not. DIRECT Run Batch uses both options, so a main Batch that calls a Batch per layer, which call their own Batches, runs as one pipeline run with three activity runs and a Batch Instance per level. Run Modules keeps the array order of the rows and reports the Batch per Module. DIRECT Run Project is removed; any Batch in the hierarchy runs with DIRECT Run Batch. Four integration tests cover the run order, closing on success, failure travelling up and a skipped aborted child Batch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
…wo analysis warnings The child Batch of the test arrangement now carries a Module, so the view test expects one row from the child instead of none. The failure path of omd.CreateBatchModuleInstances joins its table variables instead of using IN on nullable columns, and the child Batch Instance selection in omd.EndBatchModuleInstances guards the nullable status column. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for running DIRECT Batches and Modules from an orchestrator outside the repository database, with Microsoft Fabric as the first target: the repository is a SQL database in Fabric, the data and the Module executables live in a Fabric Warehouse, and Data Factory pipelines drive the runs. A Batch run is three activity runs regardless of the number of Modules and child Batches.
Repository (dacpac)
omd.CreateBatchModuleInstances: creates and evaluates a Batch Instance and the Module Instances of all active Modules in the Batch, in sequence, and returns one row per Module (Module Instance Id, executable, previous load window end value, Internal Processing Status Code, rollback statement, optional consistency timestamp). Nothing is executed.@ReturnResultSet = 'N'returns the rows as JSON in@ResultJsoninstead of a result set.@IncludeChildBatches = 'Y'also opens the active child Batches, recursively and in sequence after the Modules of the Batch itself (the order ofomd.RunBatch), and lists the Batch Instances in@BatchInstancesJson. A Batch that cannot be fully opened fails what it did open.omd.EndBatchModuleInstances: closes the Module Instances from a JSON array of results (event, load window, row counts, failure detail), fails Module Instances left without a result, and closes the Batch Instance. With@IncludeChildBatches = 'Y'it closes the child Batch Instances from the deepest level up; a failed Module or child Batch Instance fails its Batch Instance, an aborted child does not (@FailedBatchCount).omd_processing.vw_BATCH_HIERARCHY.omd.ModuleEvaluation: new parameter@ExecuteRollbackIndicatorand output@RollbackStatement, so the rollback can run on the engine that holds the data.omd.GetConsistencyTimestamp: new parameter@SourceDataLookupIndicatorto work from repository information only.omd.BatchEvaluationbuilt an invalidIN ((1,2))list in the partial rollback branch; the post-deployment seed ofomd.MODULE_INSTANCEmerged onBATCH_INSTANCE_IDand overwrote every standalone Module Instance on each publish;omd.ModuleEvaluationquoted an already quoted target in the rollback statement.Directory.Build.props,.direct-version,Releases.Direct_Framework/next/version.json,FRAMEWORK_METADATA). No table changes, so no migration script.OmdBatchModuleInstancesTests, 14 tests).fabric folder
DIRECT Run Batch(a Batch with all its child Batches, any depth, in three activity runs) andDIRECT Run Modulein the Fabric Git item layout, bound by name to a Variable LibraryDIRECT(workspace, repository and Warehouse items, connections, load window conventions).fabric/sql, templates infabric/templates, andBuild-PipelineDefinitions.ps1to regenerate the item definitions.Deploy-DirectFabric.ps1(connections, Variable Library, pipelines through the REST API),Invoke-DirectPipeline.ps1(run on demand) andSet-DirectSchedule.ps1(trickle feed schedule).@ModuleInstanceId,@StartValue,@EndValue,@ConsistencyDateTime).Testing
Deploy-DirectFabric.ps1.DIRECT Run Batchwas run end to end on a four Module Batch (landing, persistent staging, hub, satellite on a Warehouse): 54 s and 47 s, load windows carried over to the next run, zero rows loaded on the rerun.DIRECT Run Batch(60 s and 48 s, three Batch Instances linked byPARENT_BATCH_INSTANCE_ID, Modules run under the leaf, outcomes travel up), followed by a direct run of the leaf Batch (43 s).🤖 Generated with Claude Code
https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK