IExecutionResult
Represents results of execution done with particular definition.
export interface IExecutionResult extends ICancelable<IExecutionResult>
Extends: ICancelable<IExecutionResult>
Remarks
Within the result is the description of the shape of the data and methods to to obtain views on the data.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| (Optional) Arbitrary metadata carried over from the originating prepared execution. | ||
| Full definition of execution that yielded this result. | ||
| Description of shape of the data. | ||
| AbortSignal | (Optional) Abort signal to cancel the result retrieval. Note that the abort signal is shared with the prepared execution that created this result, so if you cancel the result and want to retrieve it later again, you should always create also a new execution for it. |
Methods
Method | Description |
|---|---|
Tests if this execution result is same as the other result. | |
Asynchronously exports all data in this result to a blob. Exported file is downloaded and attached as Blob data to the current window instance. | |
Unique fingerprint of the execution result. | |
Asynchronously reads all data for this result into a single data view. | |
(ALPHA) Reads anomaly detection for the execution result. | |
(ALPHA) Reads all the execution result data as a binary stream. | |
(ALPHA) Reads anomaly detection for the execution result. | |
(BETA) Reads forecast for the execution result. | |
(ALPHA) Reads outliers for the execution result. | |
Asynchronously reads a window of data for this result. | |
Transforms this execution result - changing the result sorting, dimensionality and available totals is possible through transformation. |
Property details
IExecutionResult.contextproperty
Arbitrary metadata carried over from the originating prepared execution.
readonly context?: IExecutionContext;
IExecutionResult.definitionproperty
Full definition of execution that yielded this result.
readonly definition: IExecutionDefinition;
IExecutionResult.dimensionsproperty
Description of shape of the data.
readonly dimensions: IDimensionDescriptor[];
IExecutionResult.signalproperty
Abort signal to cancel the result retrieval.
Note that the abort signal is shared with the prepared execution that created this result, so if you cancel the result and want to retrieve it later again, you should always create also a new execution for it.
readonly signal?: AbortSignal;
Method details
IExecutionResult.equals()method
Tests if this execution result is same as the other result.
equals(other: IExecutionResult): boolean;
Parameters
Parameter | Type | Description |
|---|---|---|
other | other result |
Returns
boolean
true if equal, false if not
IExecutionResult.export()method
Asynchronously exports all data in this result to a blob.
Exported file is downloaded and attached as Blob data to the current window instance.
export(options: IExportConfig): Promise<IExportResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
options | customize how the result looks like (format etc.) |
Returns
Promise<IExportResult>
promise with object URL pointing to a Blob data of downloaded exported insight
IExecutionResult.fingerprint()method
Unique fingerprint of the execution result.
fingerprint(): string;
Returns
string
Remarks
The fingerprint is influenced by both data included in the result and its dimensionality, sorting and totals.
Thus, two results with the same data and same execution definition will have the same fingerprint.
IExecutionResult.readAll()method
Asynchronously reads all data for this result into a single data view.
readAll(): Promise<IDataView>;
Returns
Promise<IDataView>
Promise of data view
IExecutionResult.readAnomalyDetectionAll()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads anomaly detection for the execution result.
readAnomalyDetectionAll(config: IAnomalyDetectionConfig): Promise<IAnomalyDetectionResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
Promise<IAnomalyDetectionResult>
IExecutionResult.readBinaryStreamAll()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads all the execution result data as a binary stream.
readBinaryStreamAll(config: IExecutionResultBinaryStreamConfig): Promise<ReadableStream>;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
Promise<ReadableStream>
IExecutionResult.readClusteringAll()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads anomaly detection for the execution result.
readClusteringAll(config: IClusteringConfig): Promise<IClusteringResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
Promise<IClusteringResult>
IExecutionResult.readForecastAll()methodBeta
Beta API. Mostly stable, but details may change in a minor release, outside SemVer. See API maturity.
Reads forecast for the execution result.
readForecastAll(config: IForecastConfig): Promise<IForecastResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
Promise<IForecastResult>
IExecutionResult.readOutliersAll()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Reads outliers for the execution result.
readOutliersAll(config: IOutliersConfig): Promise<IOutliersResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
Promise<IOutliersResult>
IExecutionResult.readWindow()method
Asynchronously reads a window of data for this result.
readWindow(offset: number[], size: number[]): Promise<IDataView>;
Parameters
Parameter | Type | Description |
|---|---|---|
offset | number[] | coordinates where the window starts |
size | number[] | size of the window in each of the dimensions |
Returns
Promise<IDataView>
Promise of data view
Remarks
The window is specified using offset array and size array. The offsets specify coordinates where the view starts and are zero-based. The sizes specify size of the window in each of the results dimension.
IExecutionResult.transform()method
Transforms this execution result - changing the result sorting, dimensionality and available totals is possible through transformation.
transform(): IPreparedExecution;
Returns
new prepared execution with no sorts, dimensions or totals
Remarks
It is strongly encouraged to use this function every time when data SHOULD remain the same and just its sorting or dimensionality or totals MUST change. That is because since this intent of the caller is known, the function can apply additional optimizations and obtain the updated result faster compared to fully running the execution.
Whether the reuse of the computed result actually happens depends on couple of factors:
Transformation is eligible: adding new native totals (roll-ups) necessitates full re-execution; all other types of changes (including adding other types of totals) are eligible for execution result reuse.
Backend capabilities: backend MAY NOT be able to natively reuse existing execution result. This is communicated by the canTransformExistingResult indicator.
If the transformation is not eligible for result reuse or the backend is not capable of this optimization, then a new execution WILL be done completely transparently for the caller.