yiguolei commented on code in PR #2720:
URL: https://github.com/apache/doris-website/pull/2720#discussion_r2262089628


##########
docs/sql-manual/sql-functions/scalar-functions/variant-functions/element-at.md:
##########
@@ -0,0 +1,109 @@
+---
+{
+    "title": "ELEMENT_AT",
+    "language": "en"
+}
+---
+
+## Function
+
+The `ELEMENT_AT` function is used to extract the element value from an array 
or map based on the specified index or key.
+
+- When applied to an **ARRAY**, it returns the element at the specified 
position.  
+- When applied to a **MAP**, it returns the value corresponding to the 
specified key.  
+- When applied to a **VARIANT**, it returns the value of the specified 
subfield.
+
+## Syntax
+
+```sql
+ELEMENT_AT(container, key_or_index)
+```
+
+## Parameters
+
+- `container`: Can be `ARRAY`, `MAP`, or `VARIANT`.
+- `key_or_index`:
+  - For `ARRAY`: An integer, with indexing starting from **1**.  
+  - For `MAP`: The key type (`K`) of the `MAP`, which can be any supported 
primitive type.  
+  - For `VARIANT`: A string type.
+
+## Return Value
+
+- For `ARRAY`: Returns the element at the specified index (`T` type).  
+- For `MAP`: Returns the value corresponding to the specified key (`V` type).  
+- For `VARIANT`: Returns a `VARIANT` type value.  
+- If the index or key does not exist, returns `NULL`.  

Review Comment:
   如果index 超过了size 是什么?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to