Torch Log Service
Function name | Function syntax | Description |
Function name | Function syntax | Description |
APPROX_PERCENTILE(KEY, percentage) | Sort the values in ascending order and return the KEY value at approximately the specified percentile. | |
| APPROX_PERCENTILE(KEY, array[percentage01, percentage02...]) | Sort the values in ascending order and return the KEY values at approximately percentile 1 and percentile 2. |
| APPROX_PERCENTILE(KEY, weight, percentage) | Sort the products of the values and weights in ascending order and return the KEY value at approximately the specified percentile. |
| APPROX_PERCENTILE(KEY, weight, array[percentage01, percentage02...]) | Sort the products of the values and weights in ascending order and return the KEY values corresponding to the 1st and 2nd percentiles. |
| APPROX_PERCENTILE(KEY, weight, percentage, accuracy) | Sort the products of a set of values and weights in ascending order, and return the value that is approximately at the specified percentile. Supports setting the accuracy. |
approx_most_frequent(KEY, x) | Counts the occurrences of each value in column x and sort the values in descending order. Then returns the top values with the highest frequency based on the key and their respective counts. |
Parameters | Description |
Parameters | Description |
KEY | A field or expression. Its values are Double type. |
percentage | Percentage value. Range: [0,1]. |
accuracy | Accuracy. Range: (0,1). |
weight | Weight, must be an integer greater than 1. After setting the weight, the system sorts based on the product of the KEY value and weight. |
Parameters | Description |
Parameters | Description |
KEY | Returns the top KEY values based on frequency; 3 means the top 3 values and their respective counts are returned. |
x | The parameter value is of varchar type. |