Support WITH options in FIRE TRIGGER#225
Merged
Merged
Conversation
Code Coverage
|
ryannedolan
approved these changes
May 18, 2026
| String name = fire.name.names.get(0); | ||
|
|
||
| Map<String, String> options = HoptimatorDdlUtils.options(fire.options); | ||
| options.put(Trigger.FIRE_OPTION, "true"); |
Collaborator
There was a problem hiding this comment.
So the difference between create trigger and fire trigger is essentially this fire: true? Wonder what happens if you create trigger ... with (fire 'true')?
Collaborator
Author
There was a problem hiding this comment.
As of now, WITH (fire 'true') on create trigger doesnt set Trigger.FIRE_OPTION. We could wire it up easily but i think it will get little more complex,
- If create trigger succeeds but the fire step fails, do we roll back the CR?
CREATE OR REPLACE ... WITH (fire 'true')needs to decide if we fire only on replace, only on create, or both?
So, i feel we should keep the firing a trigger as a separate grammar for itself.
Extend FIRE TRIGGER with an optional WITH (k v, ...) options clause whose pairs are merged into the trigger's spec.jobProperties before the fire timestamp is bumped. The deployer rejects FIRE on an in-flight execution (status.timestamp > status.watermark) so callers see explicit failure rather than racing two materialised Jobs. Option keys with the job.properties. prefix have it stripped on the way into spec.jobProperties, mirroring CREATE TRIGGER. Unprefixed keys are stored verbatim. The new Trigger.FIRE_OPTION marker carries the fire intent through DeploymentService to K8sTriggerDeployer. Why: enables FIRE TRIGGER to inject per-fire parameters (e.g. backfill window bounds) into the trigger-job pod without baking domain-specific options into the SQL grammar. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3cef5a1 to
7c7f21c
Compare
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
Extend FIRE TRIGGER with an optional WITH (k v, ...) options clause whose pairs are merged into the trigger's spec.jobProperties before the fire timestamp is bumped. The deployer rejects FIRE on an in-flight execution (status.timestamp > status.watermark) so callers see explicit failure rather than racing two triggered Jobs.
Option keys with the job.properties. prefix have it stripped on the way into spec.jobProperties, mirroring CREATE TRIGGER. Unprefixed keys are stored verbatim. The new Trigger.FIRE_OPTION marker carries the fire intent through DeploymentService to K8sTriggerDeployer.
Why: enables FIRE TRIGGER to inject per-fire parameters (e.g. backfill window bounds) into the trigger-job pod without baking domain-specific options into the SQL grammar.