You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/data/sql_functions.yml
+13-7
Original file line number
Diff line number
Diff line change
@@ -241,9 +241,9 @@ arithmetic:
241
241
- sql: UNHEX(expr)
242
242
table: expr.unhex()
243
243
description: |
244
-
Converts hexadecimal string expr to BINARY.
244
+
Converts hexadecimal string expr to BINARY. If the length of expr is odd, the first character is discarded and the result is left padded with a null byte.
245
245
246
-
If the length of expr is odd, the first character is discarded and the result is left padded with a null byte.
246
+
E.g., SELECT DECODE(UNHEX('466C696E6B') , 'UTF-8' ) or '466C696E6B'.unhex().decode('UTF-8') returns "Flink".
247
247
248
248
expr <CHAR | VARCHAR>
249
249
@@ -254,9 +254,11 @@ arithmetic:
254
254
- sql: PERCENTILE(expr, percentage[, frequency])
255
255
table: expr.percentile(percentage[, frequency])
256
256
description: |
257
-
Returns the exact percentile value of expr at the specified percentage in a group.
257
+
Returns the percentile value of expr at the specified percentage using continuous distribution.
258
258
259
-
percentage must be a literal numeric value between `[0.0, 1.0]` or an array of such values.
259
+
E.g., SELECT PERCENTILE(age, 0.25) FROM (VALUES (10), (20), (30), (40)) AS age or $('age').percentile(0.25) returns 17.5
260
+
261
+
The percentage must be a literal numeric value between `[0.0, 1.0]` or an array of such values.
260
262
If a variable expression is passed to this function, the result will be calculated using any one of them.
261
263
frequency describes how many times expr should be counted, the default value is 1.
262
264
@@ -335,6 +337,8 @@ string:
335
337
description: |
336
338
Removes any leading and trailing characters within trimStr from str. trimStr is set to whitespace by default.
337
339
340
+
E.g., BTRIM(' www.apache.org ') or ' www.apache.org '.btrim() returns "www.apache.org", BTRIM('/www.apache.org/', '/') or ' www.apache.org '.btrim() returns "www.apache.org".
341
+
338
342
str <CHAR | VARCHAR>, trimStr <CHAR | VARCHAR>
339
343
340
344
Returns a STRING representation of the trimmed str. `NULL` if any of the arguments are `NULL`.
@@ -431,10 +435,10 @@ string:
431
435
- sql: TRANSLATE(expr, fromStr, toStr)
432
436
table: expr.translate(fromStr, toStr)
433
437
description: |
434
-
Translate an expr where all characters in fromStr have been replaced with those in toStr.
435
-
436
-
If toStr has a shorter length than fromStr, unmatched characters are removed.
438
+
Translate an expr where all characters in fromStr have been replaced with those in toStr. If toStr has a shorter length than fromStr, unmatched characters are removed.
0 commit comments