StreamGraph::deleteRule
First introduced in version: 3.00.4
Syntax
StreamGraph::deleteRule(engineName, key)
Details
This function deletes the rule set associated with the specified key in the stream graph’s rule engine.
The core difference from the updateRule interface is:
- Rule changes executed via
StreamGraph::updateRuleare automatically persisted by the system, ensuring that all committed rule modifications are loaded and remain effective after a service restart. - Rule changes made via
updateRuleonly exist in memory, and the modifications will be lost after a service restart.
Parameters
engineName is a string representing the fully qualified name of the streaming
engine, such as "catalog_name.orca_engine.engine_name".
key is a STRING or INT scalar indicating the key for the rule set to be deleted.
Examples
createCatalog("demo")
go
use catalog demo
// Set the rule set
x = [1, 2, NULL]
y = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]
ruleSets = dict(x, y)
// Create and submit the stream graph
g = createStreamGraph("updateRuleDemo")
g.source("trades", 1000:0, `sym`value`price`quantity, [INT, DOUBLE, DOUBLE, DOUBLE])
.ruleEngine(ruleSets=ruleSets, outputColumns=["sym","value","price"], policy="all", ruleSetColumn="sym")
.setEngineName("myRuleEngine")
.sink("output")
g.submit()
// delete the rule
g.deleteRule("demo.orca_engine.myRuleEngine",1)
Related functions: StreamGraph::updateRule, updateRule
