Lisa Cao created SPARK-60117:
--------------------------------

             Summary: Install PyArrow in PySpark K8s Dockerfile
                 Key: SPARK-60117
                 URL: https://issues.apache.org/jira/browse/SPARK-60117
             Project: Spark
          Issue Type: Bug
          Components: Kubernetes
    Affects Versions: 4.2.0
            Reporter: Lisa Cao


Since Spark 4.2.0, regular Python UDFs are Arrow-optimized by default 
(SPARK-54555), but the PySpark K8s Docker image 
(resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/python/Dockerfile)
 only installs python3 and python3-pip. A plain {{@udf}} with no options fails 
on it:

{noformat}
ModuleNotFoundError: No module named 'pyarrow'
{noformat}

Tested by building the base and PySpark images from master's Dockerfiles over 
the 4.3.0-rc1 distribution and running UDFs through Spark Connect:

||UDF||current image||with pyarrow||
|{{@udf}} (default)|ModuleNotFoundError: No module named 'pyarrow'|OK|
|{{@udf(useArrow=False)}}|OK|OK|
|{{@pandas_udf}}|ModuleNotFoundError: No module named 'pandas'|unchanged|

The proposal is to install only {{pyarrow>=18.0.0}} (PySpark's minimum), which 
adds about 160 MB; pandas is left out because only pandas UDFs need it. PR: 
https://github.com/apache/spark/pull/59280

Originally raised against apache/spark-docker (#137, #138), whose images mirror 
this Dockerfile.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to