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/user/ppl/cmd/fillnull.rst
+74-14Lines changed: 74 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,33 @@ Using ``fillnull`` command to fill null with provided value in one or more field
16
16
17
17
Syntax
18
18
============
19
+
19
20
fillnull with <replacement> [in <field-list>]
20
21
21
22
fillnull using <field> = <replacement> [, <field> = <replacement>]
22
23
23
-
* replacement: mandatory. The value used to replace `null`s.
24
-
* field-list: optional. The comma-delimited field list. The `null` values in the field will be replaced with the values from the replacement. From 3.1.0, when ``plugins.calcite.enabled`` is true, if no field specified, the replacement is applied to all fields.
24
+
fillnull value=<replacement> [<field-list>]
25
+
26
+
27
+
Parameters
28
+
============
29
+
30
+
* replacement: Mandatory. The value used to replace `null`s.
31
+
32
+
* field-list: Optional. Comma-delimited (when using ``with`` or ``using``) or space-delimited (when using ``value=``) list of fields. The `null` values in the field will be replaced with the values from the replacement. **Default:** If no field specified, the replacement is applied to all fields.
33
+
34
+
**Syntax Variations:**
35
+
36
+
* ``with <replacement> in <field-list>`` - Apply same value to specified fields
37
+
* ``using <field>=<replacement>, ...`` - Apply different values to different fields
38
+
* ``value=<replacement> [<field-list>]`` - Alternative syntax with optional space-delimited field list
39
+
40
+
41
+
Examples
42
+
============
25
43
26
-
Example 1: replace null values with a specified value on one field
* The ``fillnull`` command is not rewritten to OpenSearch DSL, it is only executed on the coordination node.
96
-
* Before 3.1.0, at least one field is required.
146
+
* When applying the same value to all fields without specifying field names, all fields must be the same type. For mixed types, use separate fillnull commands or explicitly specify fields.
147
+
* The replacement value type must match ALL field types in the field list. When applying the same value to multiple fields, all fields must be the same type (all strings or all numeric).
148
+
149
+
**Example:**
150
+
151
+
.. code-block:: sql
152
+
153
+
# This FAILS - same value for mixed-type fields
154
+
source=accounts | fillnull value=0 firstname, age
155
+
# ERROR: fillnull failed: replacement value type INTEGER is not compatible with field 'firstname' (type: VARCHAR). The replacement value type must match the field type.
0 commit comments