This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new acedb15ea369 [SPARK-50498][PYTHON] Avoid unnecessary py4j call in 
`listFunctions`
acedb15ea369 is described below

commit acedb15ea3695c91d8ffbf207d593e9c0204ea09
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Thu Dec 5 07:47:26 2024 -0800

    [SPARK-50498][PYTHON] Avoid unnecessary py4j call in `listFunctions`
    
    ### What changes were proposed in this pull request?
    Avoid unnecessary py4j call in `listFunctions`
    
    ### Why are the changes needed?
    ```
            iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
            if pattern is None:
                iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
            else:
                iter = self._jcatalog.listFunctions(dbName, 
pattern).toLocalIterator()
    ```
    
    the first `self._jcatalog.listFunctions` is unnecessary
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    ci
    
    ### Was this patch authored or co-authored using generative AI tooling?
    no
    
    Closes #49073 from zhengruifeng/avoid_list_funcs.
    
    Authored-by: Ruifeng Zheng <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit 36285956ed2b9b8034d6918a9e951f1a2748f3ce)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 python/pyspark/sql/catalog.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/python/pyspark/sql/catalog.py b/python/pyspark/sql/catalog.py
index 2c6ed28461f3..3c22473a0623 100644
--- a/python/pyspark/sql/catalog.py
+++ b/python/pyspark/sql/catalog.py
@@ -481,7 +481,6 @@ class Catalog:
         """
         if dbName is None:
             dbName = self.currentDatabase()
-        iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
         if pattern is None:
             iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
         else:


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

Reply via email to