len
The len
method returns the length of the given input. This is useful in query strings where a user needs to get the size of a Vector
or a Java array.
Syntax
len(values)
Parameters
Parameter | Type | Description |
---|---|---|
values | byte[] | An input array for which the length will be calculated. |
values | char[] | An input array for which the length will be calculated. |
values | double[] | An input array for which the length will be calculated. |
values | float[] | An input array for which the length will be calculated. |
values | int[] | An input array for which the length will be calculated. |
values | long[] | An input array for which the length will be calculated. |
values | short[] | An input array for which the length will be calculated. |
values | LongSizedDataStructure | An input array for which the length will be calculated. |
values | T[] | An input array for which the length will be calculated. |
Returns
A long
-typed value representing the length of the input.
Example
The following example demonstrates the use of len
within a query string. Note that we must modify the "IntegerColumn"
name to "IntegerColumn_"
with the _
suffix to allow the Deephaven engine to access the column's array representation.
source = emptyTable(10).update("X = i").groupBy()
result = source.update("LenX = len(X)")
- source
- result