transform()
Home > @gooddata/sdk-backend-spi > IExecutionResult > transform
IExecutionResult.transform() method
Transforms this execution result - changing the result sorting, dimensionality and available totals is possible through transformation.
Signature:
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.