Skip to content

Commit e4f01a0

Browse files
committed
update function files
Signed-off-by: Ritvi Bhatt <[email protected]>
1 parent a422a2d commit e4f01a0

File tree

3 files changed

+25
-79
lines changed

3 files changed

+25
-79
lines changed

docs/user/ppl/functions/condition.rst

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ISNULL
1414
Description
1515
>>>>>>>>>>>
1616

17-
Usage: isnull(field) return true if field is null.
17+
Usage: isnull(field) returns true if field is null.
1818

19-
Argument type: all the supported data type.
19+
Argument type: all the supported data types.
2020

2121
Return type: BOOLEAN
2222

@@ -39,9 +39,9 @@ ISNOTNULL
3939
Description
4040
>>>>>>>>>>>
4141

42-
Usage: isnotnull(field) return true if field is not null.
42+
Usage: isnotnull(field) returns true if field is not null.
4343

44-
Argument type: all the supported data type.
44+
Argument type: all the supported data types.
4545

4646
Return type: BOOLEAN
4747

@@ -60,7 +60,7 @@ Example::
6060
EXISTS
6161
------
6262

63-
`Because OpenSearch doesn't differentiate null and missing <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html>`_. so we can't provide function like ismissing/isnotmissing to test field exist or not. But you can still use isnull/isnotnull for such purpose.
63+
`Since OpenSearch doesn't differentiate null and missing <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html>`_, we can't provide functions like ismissing/isnotmissing to test if a field exists or not. But you can still use isnull/isnotnull for such purpose.
6464

6565
Example, the account 13 doesn't have email field::
6666

@@ -78,9 +78,9 @@ IFNULL
7878
Description
7979
>>>>>>>>>>>
8080

81-
Usage: ifnull(field1, field2) return field2 if field1 is null.
81+
Usage: ifnull(field1, field2) returns field2 if field1 is null.
8282

83-
Argument type: all the supported data type, (NOTE : if two parameters has different type, you will fail semantic check.)
83+
Argument type: all the supported data types (NOTE : if two parameters have different types, you will fail semantic check).
8484

8585
Return type: any
8686

@@ -123,9 +123,9 @@ NULLIF
123123
Description
124124
>>>>>>>>>>>
125125

126-
Usage: nullif(field1, field2) return null if two parameters are same, otherwise return field1.
126+
Usage: nullif(field1, field2) returns null if two parameters are same, otherwise returns field1.
127127

128-
Argument type: all the supported data type, (NOTE : if two parameters has different type, if two parameters has different type, you will fail semantic check)
128+
Argument type: all the supported data types (NOTE : if two parameters have different types, you will fail semantic check).
129129

130130
Return type: any
131131

@@ -149,9 +149,9 @@ ISNULL
149149
Description
150150
>>>>>>>>>>>
151151

152-
Usage: isnull(field1, field2) return null if two parameters are same, otherwise return field1.
152+
Usage: isnull(field1, field2) returns null if two parameters are same, otherwise returns field1.
153153

154-
Argument type: all the supported data type
154+
Argument type: all the supported data types.
155155

156156
Return type: any
157157

@@ -174,9 +174,9 @@ IF
174174
Description
175175
>>>>>>>>>>>
176176

177-
Usage: if(condition, expr1, expr2) return expr1 if condition is true, otherwise return expr2.
177+
Usage: if(condition, expr1, expr2) returns expr1 if condition is true, otherwise returns expr2.
178178

179-
Argument type: all the supported data type, (NOTE : if expr1 and expr2 are different type, you will fail semantic check
179+
Argument type: all the supported data types (NOTE : if expr1 and expr2 are different types, you will fail semantic check).
180180

181181
Return type: any
182182

@@ -221,9 +221,9 @@ CASE
221221
Description
222222
>>>>>>>>>>>
223223

224-
Usage: case(condition1, expr1, condition2, expr2, ... conditionN, exprN else default) return expr1 if condition1 is true, or return expr2 if condition2 is true, ... if no condition is true, then return the value of ELSE clause. If the ELSE clause is not defined, it returns NULL.
224+
Usage: case(condition1, expr1, condition2, expr2, ... conditionN, exprN else default) returns expr1 if condition1 is true, or returns expr2 if condition2 is true, ... if no condition is true, then returns the value of ELSE clause. If the ELSE clause is not defined, returns NULL.
225225

226-
Argument type: all the supported data type, (NOTE : there is no comma before "else")
226+
Argument type: all the supported data types (NOTE : there is no comma before "else").
227227

228228
Return type: any
229229

@@ -266,11 +266,9 @@ COALESCE
266266
Description
267267
>>>>>>>>>>>
268268

269-
Version: 3.1.0
269+
Usage: coalesce(field1, field2, ...) returns the first non-null, non-missing value in the argument list.
270270

271-
Usage: coalesce(field1, field2, ...) return the first non-null, non-missing value in the argument list.
272-
273-
Argument type: all the supported data type. Supports mixed data types with automatic type coercion.
271+
Argument type: all the supported data types. Supports mixed data types with automatic type coercion.
274272

275273
Return type: determined by the least restrictive common type among all arguments, with fallback to string if no common type can be determined
276274

@@ -364,11 +362,9 @@ ISPRESENT
364362
Description
365363
>>>>>>>>>>>
366364

367-
Version: 3.1.0
368-
369-
Usage: ispresent(field) return true if the field exists.
365+
Usage: ispresent(field) returns true if the field exists.
370366

371-
Argument type: all the supported data type.
367+
Argument type: all the supported data types.
372368

373369
Return type: BOOLEAN
374370

@@ -392,11 +388,9 @@ ISBLANK
392388
Description
393389
>>>>>>>>>>>
394390

395-
Version: 3.1.0
396-
397391
Usage: isblank(field) returns true if the field is null, an empty string, or contains only white space.
398392

399-
Argument type: all the supported data type.
393+
Argument type: all the supported data types.
400394

401395
Return type: BOOLEAN
402396

@@ -420,11 +414,9 @@ ISEMPTY
420414
Description
421415
>>>>>>>>>>>
422416

423-
Version: 3.1.0
424-
425417
Usage: isempty(field) returns true if the field is null or is an empty string.
426418

427-
Argument type: all the supported data type.
419+
Argument type: all the supported data types.
428420

429421
Return type: BOOLEAN
430422

@@ -447,9 +439,7 @@ EARLIEST
447439
Description
448440
>>>>>>>>>>>
449441

450-
Version: 3.1.0
451-
452-
Usage: earliest(relative_string, field) returns true if the value of field is after the timestamp derived from relative_string relative to the current time. Otherwise, return false.
442+
Usage: earliest(relative_string, field) returns true if the value of field is after the timestamp derived from relative_string relative to the current time. Otherwise, returns false.
453443

454444
relative_string:
455445
The relative string can be one of the following formats:
@@ -503,9 +493,7 @@ LATEST
503493
Description
504494
>>>>>>>>>>>
505495

506-
Version: 3.1.0
507-
508-
Usage: latest(relative_string, field) returns true if the value of field is before the timestamp derived from relative_string relative to the current time. Otherwise, return false.
496+
Usage: latest(relative_string, field) returns true if the value of field is before the timestamp derived from relative_string relative to the current time. Otherwise, returns false.
509497

510498
Argument type: relative_string:STRING, field: TIMESTAMP
511499

@@ -535,8 +523,6 @@ REGEX_MATCH
535523
Description
536524
>>>>>>>>>>>
537525

538-
Version: 3.3.0
539-
540526
Usage: regex_match(string, pattern) returns true if the regular expression pattern finds a match against any substring of the string value, otherwise returns false.
541527

542528
The function uses Java regular expression syntax for the pattern.

docs/user/ppl/functions/json.rst

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ JSON
3939
Description
4040
>>>>>>>>>>>
4141

42-
Version: 3.1.0
43-
44-
Limitation: Only works when plugins.calcite.enabled=true
45-
4642
Usage: `json(value)` Evaluates whether a string can be parsed as a json-encoded string. Returns the value if valid, null otherwise.
4743

4844
Argument type: STRING
@@ -68,10 +64,6 @@ JSON_OBJECT
6864
Description
6965
>>>>>>>>>>>
7066

71-
Version: 3.1.0
72-
73-
Limitation: Only works when plugins.calcite.enabled=true
74-
7567
Usage: `json_object(key1, value1, key2, value2...)` create a json object string with key value pairs. The key must be string.
7668

7769
Argument type: key1: STRING, value1: ANY, key2: STRING, value2: ANY ...
@@ -94,10 +86,6 @@ JSON_ARRAY
9486
Description
9587
>>>>>>>>>>>
9688

97-
Version: 3.1.0
98-
99-
Limitation: Only works when plugins.calcite.enabled=true
100-
10189
Usage: `json_array(element1, element2, ...)` create a json array string with elements.
10290

10391
Argument type: element1: ANY, element2: ANY ...
@@ -120,10 +108,6 @@ JSON_ARRAY_LENGTH
120108
Description
121109
>>>>>>>>>>>
122110

123-
Version: 3.1.0
124-
125-
Limitation: Only works when plugins.calcite.enabled=true
126-
127111
Usage: `json_array_length(value)` parse the string to json array and return size,, null is returned in case of any other valid JSON string, null or an invalid JSON.
128112

129113
Argument type: value: A JSON STRING
@@ -154,10 +138,6 @@ JSON_EXTRACT
154138
Description
155139
>>>>>>>>>>>
156140

157-
Version: 3.1.0
158-
159-
Limitation: Only works when plugins.calcite.enabled=true
160-
161141
Usage: `json_extract(json_string, path1, path2, ...)` Extracts values using the specified JSON paths. If only one path is provided, it returns a single value. If multiple paths are provided, it returns a JSON Array in the order of the paths. If one path cannot find value, return null as the result for this path. The path use "{<index>}" to represent index for array, "{}" means "{*}".
162142

163143
Argument type: json_string: STRING, path1: STRING, path2: STRING ...
@@ -188,10 +168,6 @@ JSON_DELETE
188168
Description
189169
>>>>>>>>>>>
190170

191-
Version: 3.1.0
192-
193-
Limitation: Only works when plugins.calcite.enabled=true
194-
195171
Usage: `json_delete(json_string, path1, path2, ...)` Delete values using the specified JSON paths. Return the json string after deleting. If one path cannot find value, do nothing.
196172

197173
Argument type: json_string: STRING, path1: STRING, path2: STRING ...
@@ -230,10 +206,6 @@ JSON_SET
230206
Description
231207
>>>>>>>>>>>
232208

233-
Version: 3.1.0
234-
235-
Limitation: Only works when plugins.calcite.enabled=true
236-
237209
Usage: `json_set(json_string, path1, value1, path2, value2...)` Set values to corresponding paths using the specified JSON paths. If one path's parent node is not a json object, skip the path. Return the json string after setting.
238210

239211
Argument type: json_string: STRING, path1: STRING, value1: ANY, path2: STRING, value2: ANY ...
@@ -264,10 +236,6 @@ JSON_APPEND
264236
Description
265237
>>>>>>>>>>>
266238

267-
Version: 3.1.0
268-
269-
Limitation: Only works when plugins.calcite.enabled=true
270-
271239
Usage: `json_append(json_string, path1, value1, path2, value2...)` Append values to corresponding paths using the specified JSON paths. If one path's target node is not an array, skip the path. Return the json string after setting.
272240

273241
Argument type: json_string: STRING, path1: STRING, value1: ANY, path2: STRING, value2: ANY ...
@@ -306,10 +274,6 @@ JSON_EXTEND
306274
Description
307275
>>>>>>>>>>>
308276

309-
Version: 3.1.0
310-
311-
Limitation: Only works when plugins.calcite.enabled=true
312-
313277
Usage: `json_extend(json_string, path1, value1, path2, value2...)` Extend values to corresponding paths using the specified JSON paths. If one path's target node is not an array, skip the path. The function will try to parse the value as an array. If it can be parsed, extend it to the target array. Otherwise, regard the value a single one. Return the json string after setting.
314278

315279
Argument type: json_string: STRING, path1: STRING, value1: ANY, path2: STRING, value2: ANY ...
@@ -348,10 +312,6 @@ JSON_KEYS
348312
Description
349313
>>>>>>>>>>>
350314

351-
Version: 3.1.0
352-
353-
Limitation: Only works when plugins.calcite.enabled=true
354-
355315
Usage: `json_keys(json_string)` Return the key list of the Json object as a Json array. Otherwise, return null.
356316

357317
Argument type: json_string: A JSON STRING

docs/user/ppl/functions/statistical.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Description
1717

1818
Usage: max(x, y, ...) returns the maximum value from all provided arguments. Strings are treated as greater than numbers, so if provided both strings and numbers, it will return the maximum string value (lexicographically ordered)
1919

20-
Note: This function is only available in the eval command context and requires Calcite engine to be enabled.
20+
Note: This function is only available in the eval command context.
2121

2222
Argument type: Variable number of INTEGER/LONG/FLOAT/DOUBLE/STRING arguments
2323

@@ -67,7 +67,7 @@ Description
6767

6868
Usage: min(x, y, ...) returns the minimum value from all provided arguments. Strings are treated as greater than numbers, so if provided both strings and numbers, it will return the minimum numeric value.
6969

70-
Note: This function is only available in the eval command context and requires Calcite engine to be enabled.
70+
Note: This function is only available in the eval command context.
7171

7272
Argument type: Variable number of INTEGER/LONG/FLOAT/DOUBLE/STRING arguments
7373

0 commit comments

Comments
 (0)