array_rotate_right
This page explains how to use the array_rotate_right function in APL.
The array_rotate_right
function in APL allows you to rotate the elements of an array to the right by a specified number of positions. This function is useful when you need to reorder data within arrays, either to shift recent events to the beginning, reorder log entries, or realign elements based on specific processing logic.
For users of other query languages
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Usage
Syntax
Parameters
array
: An array to rotate.count
: An integer specifying the number of positions to rotate the array to the right.
Returns
An array where the elements are rotated to the right by the specified count
.
Use case example
In OpenTelemetry traces, rotating an array of span details can help you reorder trace information for performance tracking or troubleshooting.
Query
Output
List of related functions
- array_length: Returns the number of elements in an array.
- array_index_of: Finds the index of an element in an array.
- array_rotate_left: Rotates elements of an array to the left.
Was this page helpful?