Update SQL function argument descriptions (#4839)
* updated sql function argument descriptions * other fixes to sql function arg descriptionspull/4846/head
parent
274b5fb833
commit
0b5c13f99b
|
@ -60,7 +60,8 @@ avg(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
##### Aliases
|
||||
|
||||
|
@ -99,7 +100,8 @@ count(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `count` query example" %}}
|
||||
|
@ -133,7 +135,8 @@ _To return both the maximum value and its associated timestamp, use
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `max` query example" %}}
|
||||
|
@ -171,7 +174,8 @@ _To return both the minimum value and its associated timestamp, use
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `min` query example" %}}
|
||||
|
@ -202,7 +206,8 @@ sum(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `sum` query example" %}}
|
||||
|
@ -387,7 +392,8 @@ stddev(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `stddev` query example" %}}
|
||||
|
@ -421,7 +427,8 @@ stddev_pop(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `stddev_pop` query example" %}}
|
||||
|
@ -455,7 +462,8 @@ stddev_samp(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `stddev_samp` query example" %}}
|
||||
|
@ -489,7 +497,8 @@ var(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `var` query example" %}}
|
||||
|
@ -523,7 +532,8 @@ var_pop(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `var_pop` query example" %}}
|
||||
|
@ -557,7 +567,8 @@ var_samp(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `var_samp` query example" %}}
|
||||
|
@ -599,7 +610,8 @@ approx_distinct(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `approx_distinct` query example" %}}
|
||||
|
@ -634,7 +646,8 @@ approx_median(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `approx_median` query example" %}}
|
||||
|
@ -668,7 +681,8 @@ approx_percentile_cont(expression, percentile, centroids)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **percentile**: Percentile to compute. Must be a float value between 0 and 1 (inclusive).
|
||||
- **centroids**: Number of centroids to use in the t-digest algorithm. _Default is 100_.
|
||||
|
||||
|
@ -709,8 +723,10 @@ approx_percentile_cont_with_weight(expression, weight, percentile)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **weight**: Column or literal value to use as weight.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **weight**: Expression to use as weight.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **percentile**: Percentile to compute. Must be a float value between 0 and 1 (inclusive).
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
|
|
|
@ -29,8 +29,9 @@ coalesce(expression1[, ..., expression_n])
|
|||
##### Arguments
|
||||
|
||||
- **expression1, expression_n**:
|
||||
Column or literal value to use if previous expressions are _null_.
|
||||
Pass as many expression arguments as necessary.
|
||||
Expression to use if previous expressions are _null_.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
Pass as many expression arguments as necessary.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `coalesce` query example" %}}
|
||||
|
@ -70,8 +71,10 @@ nullif(expression1, expression2)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression1**: Column or literal value to compare and return if equal to expression2.
|
||||
- **expression2**: Column or literal value to compare to expression1.
|
||||
- **expression1**: Expression to compare and return if equal to expression2.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **expression2**: Expression to compare to expression1.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `nullif` query example" %}}
|
||||
|
|
|
@ -44,7 +44,8 @@ abs(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `abs` query example" %}}
|
||||
|
@ -75,7 +76,8 @@ acos(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `acos` query example" %}}
|
||||
|
@ -106,7 +108,8 @@ asin(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `asin` query example" %}}
|
||||
|
@ -137,7 +140,8 @@ atan(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `atan` query example" %}}
|
||||
|
@ -163,13 +167,15 @@ SELECT atan(temp * .01) AS atan FROM home LIMIT 3
|
|||
Returns the arc tangent or inverse tangent of `expression_y / expression_x`.
|
||||
|
||||
```sql
|
||||
atan2(expression_y / expression_x)
|
||||
atan2(expression_y, expression_x)
|
||||
```
|
||||
|
||||
##### Arguments
|
||||
|
||||
- **expression_y**: First numeric column or literal value to operate on.
|
||||
- **expression_x**: Second numeric column or literal value to operate on.
|
||||
- **expression_y**: First numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **expression_x**: Second numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `atan2` query example" %}}
|
||||
|
@ -200,7 +206,8 @@ ceil(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `ceil` query example" %}}
|
||||
|
@ -231,7 +238,8 @@ cos(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `cos` query example" %}}
|
||||
|
@ -262,7 +270,8 @@ exp(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to use as the exponent.
|
||||
- **numeric_expression**: Numeric expression to use as the exponent.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `exp` query example" %}}
|
||||
|
@ -293,7 +302,8 @@ floor(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `floor` query example" %}}
|
||||
|
@ -324,7 +334,8 @@ ln(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `ln` query example" %}}
|
||||
|
@ -355,7 +366,8 @@ log10(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `log10` query example" %}}
|
||||
|
@ -386,7 +398,8 @@ log2(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `log2` query example" %}}
|
||||
|
@ -417,8 +430,10 @@ power(base, exponent)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **power**: Base numeric column or literal value to operate on.
|
||||
- **exponent**: Exponent numeric column or literal value to operate on.
|
||||
- **power**: Base numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
- **exponent**: Exponent numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `power` query example" %}}
|
||||
|
@ -481,7 +496,8 @@ round(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `round` query example" %}}
|
||||
|
@ -514,7 +530,8 @@ signum(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `signum` query example" %}}
|
||||
|
@ -545,7 +562,8 @@ sin(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `sin` query example" %}}
|
||||
|
@ -576,7 +594,8 @@ sqrt(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `sqrt` query example" %}}
|
||||
|
@ -607,7 +626,8 @@ tan(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `tan` query example" %}}
|
||||
|
@ -638,7 +658,8 @@ trunc(numeric_expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **numeric_expression**: Numeric column or literal value to operate on.
|
||||
- **numeric_expression**: Numeric expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `trunc` query example" %}}
|
||||
|
|
|
@ -13,12 +13,52 @@ weight: 310
|
|||
The InfluxDB SQL implementation supports the following miscellaneous functions
|
||||
for performing a variety of operations:
|
||||
|
||||
- [arrow_cast](#arrow_cast)
|
||||
- [arrow_typeof](#arrow_typeof)
|
||||
<!-- - [struct](#struct) -->
|
||||
|
||||
### `arrow_cast`
|
||||
|
||||
Casts a value to a specific Arrow data type.
|
||||
|
||||
```sql
|
||||
arrow_cast(expression, datatype)
|
||||
```
|
||||
|
||||
#### Arguments
|
||||
|
||||
- **expression**: Expression to cast.
|
||||
Can be a constant, column, or function, and any combination of arithmetic or
|
||||
string operators.
|
||||
- **datatype**: [Arrow data type](https://arrow.apache.org/datafusion/user-guide/sql/data_types.html)
|
||||
to cast to.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `arrow_cast` query example" %}}
|
||||
|
||||
_The following example uses the sample data set provided in
|
||||
[Get started with InfluxDB tutorial](/influxdb/cloud-iox/get-started/write/#construct-line-protocol)._
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
arrow_cast(time, 'Int64') AS time,
|
||||
arrow_cast(temp, 'Utf8') AS temp,
|
||||
arrow_cast(co, 'Float64')AS co
|
||||
FROM home
|
||||
LIMIT 1
|
||||
```
|
||||
|
||||
| time | temp | co |
|
||||
| :------------------ | ---: | --: |
|
||||
| 1641024000000000000 | 21.0 | 0 |
|
||||
|
||||
{{% /expand %}}
|
||||
{{< /expand-wrapper >}}
|
||||
|
||||
## arrow_typeof
|
||||
|
||||
Returns the underlying [Arrow type]() of the the expression:
|
||||
Returns the underlying [Arrow data type](https://arrow.apache.org/datafusion/user-guide/sql/data_types.html)
|
||||
of the the expression:
|
||||
|
||||
```sql
|
||||
arrow_typeof(expression)
|
||||
|
@ -26,7 +66,9 @@ arrow_typeof(expression)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to evaluate.
|
||||
- **expression**: Expression to evaluate.
|
||||
Can be a constant, column, or function, and any combination of arithmetic or
|
||||
string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `arrow_typeof` query example" %}}
|
||||
|
@ -64,7 +106,9 @@ struct(expression1[, ..., expression_n])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression_n**: Column or literal value to include in the output struct.
|
||||
- **expression_n**: Expression to include in the output struct.
|
||||
Can be a constant, column, or function, and any combination of arithmetic or
|
||||
string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `struct` example" %}}
|
||||
|
|
|
@ -29,8 +29,10 @@ regexp_match(str, regexp)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **regexp**: Regular expression to match against.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
-->
|
||||
|
||||
|
@ -44,9 +46,12 @@ regexp_replace(str, regexp, replacement, flags)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **regexp**: Regular expression to match against.
|
||||
- **replacement**: Replacement string.
|
||||
Can be a constant, column, or function.
|
||||
- **replacement**: Replacement string expression.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **flags**: Regular expression flags that control the behavior of the
|
||||
regular expression. The following flags are supported.
|
||||
- **g**: (global) Search globally and don't return after the first match.
|
||||
|
|
|
@ -77,8 +77,11 @@ selector_min(expression, timestamp)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **timestamp**: Time column or timestamp literal.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string or
|
||||
arithmetic operators.
|
||||
- **timestamp**: Time expression.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `selector_min` query example" %}}
|
||||
|
@ -107,8 +110,11 @@ selector_max(expression, timestamp)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **timestamp**: Time column or timestamp literal.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string or
|
||||
arithmetic operators.
|
||||
- **timestamp**: Time expression.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `selector_max` query example" %}}
|
||||
|
@ -137,8 +143,11 @@ selector_first(expression, timestamp)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **timestamp**: Time column or timestamp literal.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string or
|
||||
arithmetic operators.
|
||||
- **timestamp**: Time expression.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `selector_first` query example" %}}
|
||||
|
@ -167,8 +176,11 @@ selector_last(expression, timestamp)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **timestamp**: Time column or timestamp literal.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string or
|
||||
arithmetic operators.
|
||||
- **timestamp**: Time expression.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `selector_last` query example" %}}
|
||||
|
|
|
@ -59,7 +59,8 @@ ascii(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -101,7 +102,8 @@ bit_length(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -140,9 +142,11 @@ btrim(str[, trim_str])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **trim_str**: String column or literal string to trim from the beginning and
|
||||
end of the input string. _Default is whitespace characters_.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **trim_str**: String expression to trim from the beginning and end of the input string.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
_Default is whitespace characters_.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -189,8 +193,9 @@ concat(str[, ..., str_n])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to concatenate.
|
||||
- **str_n**: Subsequent string column or literal string to concatenate.
|
||||
- **str**: String expression to concatenate.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **str_n**: Subsequent string expression to concatenate.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -233,8 +238,10 @@ concat(separator, str[, ..., str_n])
|
|||
##### Arguments
|
||||
|
||||
- **separator**: Separator to insert between concatenated strings.
|
||||
- **str**: String column or literal string to concatenate.
|
||||
- **str_n**: Subsequent string column or literal string to concatenate.
|
||||
- **str**: String expression to concatenate.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **str_n**: Subsequent string expression to concatenate.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -268,15 +275,17 @@ LIMIT 3
|
|||
|
||||
## chr
|
||||
|
||||
Returns the character with the specified ASCII code value.
|
||||
Returns the character with the specified ASCII or Unicode code value.
|
||||
|
||||
```sql
|
||||
chr(acsii)
|
||||
```
|
||||
chr(expression)
|
||||
```
|
||||
|
||||
##### Arguments
|
||||
#### Arguments
|
||||
|
||||
- **ascii**: ASCII code value to operate on.
|
||||
- **expression**: Expression containing the ASCII or Unicode code value to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic or
|
||||
string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -316,7 +325,8 @@ initcap(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -356,7 +366,8 @@ left(str, n)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **n**: Number of characters to return.
|
||||
|
||||
##### Related functions
|
||||
|
@ -399,7 +410,8 @@ length(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Aliases
|
||||
|
||||
|
@ -442,7 +454,8 @@ lower(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -480,9 +493,11 @@ lpad(str, n[, padding_str])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **n**: String length to pad to.
|
||||
- **padding_str**: String column or literal string to pad with.
|
||||
- **padding_str**: String expression to pad with.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
_Default is a space._
|
||||
|
||||
##### Related functions
|
||||
|
@ -520,7 +535,8 @@ ltrim(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -553,7 +569,7 @@ FROM
|
|||
|
||||
## md5
|
||||
|
||||
Calculates and returns an MD5 128-bit checksum for a string.
|
||||
Computes an MD5 128-bit checksum for a string expression.
|
||||
|
||||
```sql
|
||||
md5(str)
|
||||
|
@ -561,7 +577,8 @@ md5(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **expression**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `md5` query example" %}}
|
||||
|
@ -599,7 +616,8 @@ octet_length(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -637,7 +655,8 @@ repeat(str, n)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to repeat.
|
||||
- **str**: String expression to repeat.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **n**: Number of times to repeat the input string.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
|
@ -673,9 +692,12 @@ replace(str, substr, replacement)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to repeat.
|
||||
- **substr**: Substring to replace in the input string.
|
||||
- **replacement**: Replacement substring.
|
||||
- **str**: String expression to repeat.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **substr**: Substring expression to replace in the input string.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **replacement**: Replacement substring expression.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `replace` query example" %}}
|
||||
|
@ -708,7 +730,8 @@ reverse(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to repeat.
|
||||
- **str**: String expression to repeat.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `reverse` query example" %}}
|
||||
|
@ -741,7 +764,8 @@ right(str, n)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **n**: Number of characters to return.
|
||||
|
||||
##### Related functions
|
||||
|
@ -778,9 +802,11 @@ rpad(str, n[, padding_str])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **n**: String length to pad to.
|
||||
- **padding_str**: String column or literal string to pad with.
|
||||
- **padding_str**: String expression to pad with.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
_Default is a space._
|
||||
|
||||
##### Related functions
|
||||
|
@ -818,7 +844,8 @@ rtrim(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -860,7 +887,8 @@ split_part(str, delimiter, pos)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to spit.
|
||||
- **str**: String expression to spit.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **delimiter**: String or character to split on.
|
||||
- **pos**: Position of the part to return.
|
||||
|
||||
|
@ -897,7 +925,8 @@ starts_with(str, substr)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to test.
|
||||
- **str**: String expression to test.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **substr**: Substring to test for.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
|
@ -938,8 +967,10 @@ strpos(str, substr)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **substr**: Substring to search for.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **substr**: Substring expression to search for.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `strpos` query example" %}}
|
||||
|
@ -973,7 +1004,8 @@ substr(str, start_pos[, length])
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **start_pos**: Character position to start the substring at.
|
||||
The first character in the string has a position of 1.
|
||||
- **length**: Number of characters to extract.
|
||||
|
@ -1008,7 +1040,8 @@ Translates characters in a string to specified translation characters.
|
|||
translate(str, chars, translation)
|
||||
```
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
- **chars**: Characters to translate.
|
||||
- **translation**: Translation characters. Translation characters replace only
|
||||
characters at the same position in the **chars** string.
|
||||
|
@ -1044,7 +1077,8 @@ to_hex(int)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **int**: Integer column or literal integer to convert.
|
||||
- **int**: Integer expression to convert.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `to_hex` query example" %}}
|
||||
|
@ -1079,7 +1113,8 @@ trim(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
@ -1120,7 +1155,8 @@ upper(str)
|
|||
|
||||
##### Arguments
|
||||
|
||||
- **str**: String column or literal string to operate on.
|
||||
- **str**: String expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of string operators.
|
||||
|
||||
##### Related functions
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@ date_bin(interval, expression, origin-timestamp)
|
|||
##### Arguments:
|
||||
|
||||
- **interval**: Bin interval.
|
||||
- **expression**: Column or timestamp literal to operate on.
|
||||
- **expression**: Time expression to operate on.
|
||||
Can be a constant, column, or function.
|
||||
- **timestamp**: Starting point used to determine bin boundaries.
|
||||
|
||||
The following intervals are supported:
|
||||
|
@ -123,17 +124,18 @@ date_trunc(precision, expression)
|
|||
##### Arguments:
|
||||
|
||||
- **precision**: Time precision to truncate to.
|
||||
The following precisions are supported:
|
||||
The following precisions are supported:
|
||||
|
||||
- year
|
||||
- month
|
||||
- week
|
||||
- day
|
||||
- hour
|
||||
- minute
|
||||
- second
|
||||
|
||||
- **expression**: Column or timestamp literal to operate on.
|
||||
- year
|
||||
- month
|
||||
- week
|
||||
- day
|
||||
- hour
|
||||
- minute
|
||||
- second
|
||||
|
||||
- **expression**: Time expression to operate on.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `date_trunc` query examples" %}}
|
||||
|
@ -198,22 +200,23 @@ date_part(part, expression)
|
|||
##### Arguments:
|
||||
|
||||
- **part**: Part of the date to return.
|
||||
The follow date parts are supported:
|
||||
The following date parts are supported:
|
||||
|
||||
- year
|
||||
- month
|
||||
- week _(week of the year)_
|
||||
- day _(day of the month)_
|
||||
- hour
|
||||
- minute
|
||||
- second
|
||||
- millisecond
|
||||
- microsecond
|
||||
- nanosecond
|
||||
- dow _(day of the week)_
|
||||
- doy _(day of the year)_
|
||||
|
||||
- **expression**: Column or timestamp literal to operate on.
|
||||
- year
|
||||
- month
|
||||
- week _(week of the year)_
|
||||
- day _(day of the month)_
|
||||
- hour
|
||||
- minute
|
||||
- second
|
||||
- millisecond
|
||||
- microsecond
|
||||
- nanosecond
|
||||
- dow _(day of the week)_
|
||||
- doy _(day of the year)_
|
||||
|
||||
- **expression**: Time expression to operate on.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `date_part` query examples" %}}
|
||||
|
@ -252,6 +255,27 @@ Similar to `date_part`, but with different arguments.
|
|||
extract(field FROM source)
|
||||
```
|
||||
|
||||
##### Arguments
|
||||
|
||||
- **field**: Part or field of the date to return.
|
||||
The following date fields are supported:
|
||||
|
||||
- year
|
||||
- month
|
||||
- week _(week of the year)_
|
||||
- day _(day of the month)_
|
||||
- hour
|
||||
- minute
|
||||
- second
|
||||
- millisecond
|
||||
- microsecond
|
||||
- nanosecond
|
||||
- dow _(day of the week)_
|
||||
- doy _(day of the year)_
|
||||
|
||||
- **source**: Source time expression to operate on.
|
||||
Can be a constant, column, or function.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `extract` query example" %}}
|
||||
|
||||
|
@ -283,7 +307,8 @@ to_timestamp(expression)
|
|||
|
||||
##### Arguments:
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `to_timestamp` query example" %}}
|
||||
|
@ -314,7 +339,8 @@ to_timestamp_millis(expression)
|
|||
|
||||
##### Arguments:
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `to_timestamp_millis` query example" %}}
|
||||
|
@ -348,7 +374,8 @@ to_timestamp_micros(expression)
|
|||
|
||||
##### Arguments:
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `to_timestamp_micros` query example" %}}
|
||||
|
@ -367,7 +394,6 @@ LIMIT 1
|
|||
{{% /expand %}}
|
||||
{{< /expand-wrapper >}}
|
||||
|
||||
|
||||
### to_timestamp_seconds
|
||||
|
||||
Converts a value to RFC3339 second timestamp format (`YYYY-MM-DDT00:00:00Z`).
|
||||
|
@ -381,7 +407,8 @@ to_timestamp_seconds(expression)
|
|||
|
||||
##### Arguments:
|
||||
|
||||
- **expression**: Column or literal value to operate on.
|
||||
- **expression**: Expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `to_timestamp_seconds` query example" %}}
|
||||
|
@ -414,7 +441,8 @@ from_unixtime(expression)
|
|||
|
||||
##### Arguments:
|
||||
|
||||
- **expression**: Column or integer literal to operate on.
|
||||
- **expression**: Integer expression to operate on.
|
||||
Can be a constant, column, or function, and any combination of arithmetic operators.
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View `from_unixtime` query example" %}}
|
||||
|
|
Loading…
Reference in New Issue