addSparseReactiveMetrics

Syntax

addSparseReactiveMetrics(name, metrics)

Details

Adds sparse state computation rules to the specified SparseReactiveStateEngine. The format of the new metrics is the same as the metrics parameter of createSparseReactiveStateEngine.

Parameters

name is a STRING scalar indicating the name of the SparseReactiveStateEngine to which rules are added.

metrics is a table representing the set of rules to be added. Its schema is the same as the metrics parameter of createSparseReactiveStateEngine: keyColumn(s), formula, outputMetricKey.

Note:
  • For the standalone and cluster mode, user-defined functions in the formula field only support metacode in <> format when using Orca.
  • For cluster mode:
    • When calling addSparseReactiveMetrics via rpc, the formula must use string in "" format, or log in directly to the node where the engine is located.
    • If the engine contains code in <> format, calling getSparseReactiveMetrics via rpc will behave abnormally. It is also recommended to log in directly to the node where the engine is located.

Returns

Returns no value or returns an execution status (subject to the actual product implementation).