uros-b commented on code in PR #58301:
URL: https://github.com/apache/spark/pull/58301#discussion_r4070951166


##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -23416,6 +23416,45 @@ def is_variant_null(v: "ColumnOrName") -> Column:
     return _invoke_function("is_variant_null", _to_java_column(v))
 
 
+@_try_remote_functions
+def variant_array_length(v: "ColumnOrName", path: Optional[Union[Column, str]] 
= None) -> Column:
+    """
+    Returns the number of elements in the variant array at `path`. If `path` 
is omitted, the root
+    array is inspected. Returns NULL if the input is SQL NULL, the path does 
not exist, or the
+    target is a variant null or any non-array variant value.
+
+    .. versionadded:: 5.0.0

Review Comment:
   ```suggestion
       .. versionadded:: 4.4.0
   ```



##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -14870,6 +14870,53 @@ object functions {
    */
   def is_variant_null(v: Column): Column = Column.fn("is_variant_null", v)
 
+  /**
+   * Returns the number of elements in a variant array. Returns NULL if the 
input is SQL NULL, a
+   * variant null, or any non-array variant value.
+   *
+   * @param v
+   *   a variant column. A column that evaluates to a variant.
+   * @group variant_funcs
+   * @since 5.0.0

Review Comment:
   ```suggestion
      * @since 4.4.0
   ```



-- 
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