You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/03 12:26:35 UTC

[GitHub] [spark] HyukjinKwon opened a new pull request #29639: [SPARK-32783][DOCS][PYTHON] User Guide - Debugging

HyukjinKwon opened a new pull request #29639:
URL: https://github.com/apache/spark/pull/29639


   ### What changes were proposed in this pull request?
   
   This PR proposes to document the way of debugging PySpark. It's pretty much self-descriptive.
   
   I made a demo site to review it more effectively:
   
   ### Why are the changes needed?
   
   To let users know how to debug PySpark applications.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it adds a new page in the documentation about debugging PySpark.
   
   ### How was this patch tested?
   
   Manually built the doc.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
srowen commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r482975706



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.

Review comment:
       Maybe: "This section describes remote debugging within a single machine .."

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction

Review comment:
       Slightly better is "If a PySpark application does not require interaction ..."

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 

Review comment:
       PyCharm, documented here

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.

Review comment:
       Choose Edit Configuration from the Run menu
   manu -> menu
   
   Start a new sentence. "It opens the Run/Debug ..."

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific

Review comment:
       on other machines

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command
+to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directly, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python workers in your PySpark applications by using ``spark.python.daemon.module`` configuration.

Review comment:
       workers -> worker
   using the ... configuration

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command
+to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directly, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python workers in your PySpark applications by using ``spark.python.daemon.module`` configuration.
+Run ``pyspark`` shell with the configuration below:
+
+.. code-block:: bash
+
+    pyspark --conf spark.python.daemon.module=remote_debug
+
+Now you're ready to remote debug. Start debug with your ``MyRemoteDebugger``.

Review comment:
       Start debugging

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command
+to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directly, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python workers in your PySpark applications by using ``spark.python.daemon.module`` configuration.
+Run ``pyspark`` shell with the configuration below:

Review comment:
       Run the pyspark shell with ... , or Run pyspark with

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command
+to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directly, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python workers in your PySpark applications by using ``spark.python.daemon.module`` configuration.
+Run ``pyspark`` shell with the configuration below:
+
+.. code-block:: bash
+
+    pyspark --conf spark.python.daemon.module=remote_debug
+
+Now you're ready to remote debug. Start debug with your ``MyRemoteDebugger``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug2.png
+    :alt: PyCharm run remote debugger
+
+After that, run a job that creates a Python workers, for example, as below:
+
+.. code-block:: python
+
+    spark.range(10).repartition(1).rdd.map(lambda x: x).collect()
+
+
+Checking Memory and CPU Usage
+-----------------------------
+
+Python workers are typically monitored via ``top`` and ``ps`` commands because Python workers launch multiple Python

Review comment:
       Python workers create multiple Python processes

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command
+to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directly, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python workers in your PySpark applications by using ``spark.python.daemon.module`` configuration.
+Run ``pyspark`` shell with the configuration below:
+
+.. code-block:: bash
+
+    pyspark --conf spark.python.daemon.module=remote_debug
+
+Now you're ready to remote debug. Start debug with your ``MyRemoteDebugger``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug2.png
+    :alt: PyCharm run remote debugger
+
+After that, run a job that creates a Python workers, for example, as below:

Review comment:
       creates Python workers

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,188 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. In case that PySpark applications do not require the interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+In this section, it describes the remote debug within single machine to demonstrate easily.
+In order to debug PySpark applications in other machines, please refer to the full instructions that are specific
+to PyCharm is documented at `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Run | Edit Configuration...** in the main manu, and it opens the Run/debug configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+After that, you should install the corresponding version of ``pydevd-pycahrm`` package. In the previous dialog, it shows the command

Review comment:
       of the ... package




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687039835






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686884086


   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/128273/
   Test PASSed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686874465


   **[Test build #128273 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128273/testReport)** for PR 29639 at commit [`cea4be4`](https://github.com/apache/spark/commit/cea4be49ad0dfce4622959cc7e8782afd4c90e90).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688573613






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688014688






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483486376



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)

Review comment:
       > And maybe link to pydev remote debugger docs as an alternative.
   
   This one, I think we'll leave it as a future work. It'd be nice if somebody document this as well.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688018881


   **[Test build #128335 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128335/testReport)** for PR 29639 at commit [`8162dfc`](https://github.com/apache/spark/commit/8162dfc5ee6ee761d4362176406350e3250e11f9).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688573613






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688016741


   **[Test build #128334 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128334/testReport)** for PR 29639 at commit [`99b8c1e`](https://github.com/apache/spark/commit/99b8c1e5c89dfecf4e7fb694e22043cf5ef9f373).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687027881






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688014688






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688026561


   **[Test build #128335 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128335/testReport)** for PR 29639 at commit [`8162dfc`](https://github.com/apache/spark/commit/8162dfc5ee6ee761d4362176406350e3250e11f9).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687956266






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483486376



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)

Review comment:
       > And maybe link to pydev remote debugger docs as an alternative.
   
   This one, I think I'll just leave it as a future work. It'd be nice if somebody document this as well.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686884077


   Merged build finished. Test PASSed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688567923


   I am going to merge this. I updated the link here: https://hyukjin-spark.readthedocs.io/en/stable/development/debugging.html 
   Please feel free to leave a comment - I will address them in followups.
   
   Merged to master.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483366839



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+This section describes remote debugging within a single machine to demonstrate easily.
+In order to debug PySpark applications on other machines, please refer to the full instructions that are specific
+to PyCharm, documented `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Edit Configuration...** from the **Run** menu. It opens the Run/debug Configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+| After that, you should install the corresponding version of the ``pydevd-pycahrm`` package. In the previous dialog, it shows the command to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directory, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python worker in your PySpark applications by using the ``spark.python.daemon.module`` configuration.
+Run the ``pyspark`` shell with the configuration below:
+
+.. code-block:: bash
+
+    pyspark --conf spark.python.daemon.module=remote_debug
+
+Now you're ready to remote debug. Start debugging with your ``MyRemoteDebugger``.

Review comment:
       remote debug -> remotely debug

##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)
+--------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+This section describes remote debugging within a single machine to demonstrate easily.
+In order to debug PySpark applications on other machines, please refer to the full instructions that are specific
+to PyCharm, documented `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config>`_. 
+
+Firstly, choose **Edit Configuration...** from the **Run** menu. It opens the Run/debug Configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+| After that, you should install the corresponding version of the ``pydevd-pycahrm`` package. In the previous dialog, it shows the command to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+In your current working directory, prepare a Python file as below:
+
+.. code-block:: bash
+
+    echo "from pyspark import daemon, worker
+    def remote_debug_wrapped(*args, **kwargs):
+        #======================Copy and paste from the previous dialog===========================
+        import pydevd_pycharm
+        pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+        #========================================================================================
+        worker.main(*args, **kwargs)
+    daemon.worker_main = remote_debug_wrapped
+    if __name__ == '__main__':
+        daemon.manager()" > remote_debug.py
+
+You will use this file as the Python worker in your PySpark applications by using the ``spark.python.daemon.module`` configuration.
+Run the ``pyspark`` shell with the configuration below:
+
+.. code-block:: bash
+
+    pyspark --conf spark.python.daemon.module=remote_debug
+
+Now you're ready to remote debug. Start debugging with your ``MyRemoteDebugger``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug2.png
+    :alt: PyCharm run remote debugger
+
+| After that, run a job that creates Python workers, for example, as below:
+
+.. code-block:: python
+
+    spark.range(10).repartition(1).rdd.map(lambda x: x).collect()
+
+
+Checking Memory and CPU Usage
+-----------------------------
+
+Python workers are typically monitored via ``top`` and ``ps`` commands because Python workers create multiple Python processes
+workers are created as processes. As an example, you can ``ps`` as below:

Review comment:
       Is `workers are created as processes` redundant?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687039835






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686461275


   Again, I am going to proofread by myself few more times but .. cc @srowen, @viirya, @BryanCutler, @huaxingao, @zhengruifeng, @holdenk, @Fokko and @zero323. It would be great if I can have some feedback about it.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687948686






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483723369



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm Professional)
+---------------------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+This section describes remote debugging within a single machine to demonstrate easily.
+In order to debug PySpark applications on other machines, please refer to the full instructions that are specific
+to PyCharm, documented `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html>`_.
+
+Firstly, choose **Edit Configuration...** from the **Run** menu. It opens the Run/debug Configurations dialog.

Review comment:
       Nit: **Run/Debug Configurations**




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687956266






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686906035


   **[Test build #128275 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128275/testReport)** for PR 29639 at commit [`70adf81`](https://github.com/apache/spark/commit/70adf815715405060796b7ff8d34f58149b2d0bb).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687027194


   **[Test build #128292 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128292/testReport)** for PR 29639 at commit [`ee9fb77`](https://github.com/apache/spark/commit/ee9fb77cd7b51c2ba83cfd85b775c8d372f4ca40).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688573393


   **[Test build #128367 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128367/testReport)** for PR 29639 at commit [`adcbe4f`](https://github.com/apache/spark/commit/adcbe4f5f67dac7d7fdccc6fdde5e987aa104863).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon edited a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon edited a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688018098


   The link here https://hyukjin-spark.readthedocs.io/en/stable/development/debugging.html is also updated. FYI, you might need to use incognito tab or something like that to prevent to show the cached site if it shows the previous page.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688568409


   Thank you guys for reviewing this.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon closed pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #29639:
URL: https://github.com/apache/spark/pull/29639


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687956009


   **[Test build #128329 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128329/testReport)** for PR 29639 at commit [`9a675d3`](https://github.com/apache/spark/commit/9a675d335078164b072e2f2c1c788abfcbc19db6).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483723432



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm Professional)
+---------------------------------------
+
+In order to debug the Python workers remotely, you should connect from the Python worker to the debug server in PyCharm.
+This section describes remote debugging within a single machine to demonstrate easily.
+In order to debug PySpark applications on other machines, please refer to the full instructions that are specific
+to PyCharm, documented `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html>`_.
+
+Firstly, choose **Edit Configuration...** from the **Run** menu. It opens the Run/debug Configurations dialog.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this run/debug configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.

Review comment:
       Nit: **Run/Debug Configurations**




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017434






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r484173595



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,280 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. PySpark uses `Py4J <https://www.py4j.org/>`_ to leverage Spark to submit and computes the jobs.
+
+On the driver side, PySpark communicates with the driver on JVM by using `Py4J <https://www.py4j.org/>`_.
+When :class:`pyspark.sql.SparkSession` or :class:`pyspark.SparkContext` is created and initialized, PySpark launches a JVM
+to communicate.
+
+On the executor side, Python workers execute and handle Python native functions or data. They are not launched if
+a PySpark application does not require interaction between Python workers and JVMs. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page focuses on debugging Python side of PySpark on both driver and executor sides instead of focusing on debugging
+with JVM. Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+Note that,
+
+- If you are running locally, you can directly debug the driver side via using your IDE without the remote debug feature.

Review comment:
       BTW, @itholic is working on documenting local PyCharm setup in another page (at SPARK-32189). We could add a link here once that page is finished.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687024073






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686474711






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688018098


   The link here https://hyukjin-spark.readthedocs.io/en/stable/development/debugging.html is also updated.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688566440






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687039201


   **[Test build #128290 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128290/testReport)** for PR 29639 at commit [`641eb36`](https://github.com/apache/spark/commit/641eb365597ae5ac2864fe9216d8b8b6901eaf4e).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r484171058



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,280 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. PySpark uses `Py4J <https://www.py4j.org/>`_ to leverage Spark to submit and computes the jobs.
+
+On the driver side, PySpark communicates with the driver on JVM by using `Py4J <https://www.py4j.org/>`_.
+When :class:`pyspark.sql.SparkSession` or :class:`pyspark.SparkContext` is created and initialized, PySpark launches a JVM
+to communicate.
+
+On the executor side, Python workers execute and handle Python native functions or data. They are not launched if
+a PySpark application does not require interaction between Python workers and JVMs. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page focuses on debugging Python side of PySpark on both driver and executor sides instead of focusing on debugging
+with JVM. Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+Note that,
+
+- If you are running locally, you can directly debug the driver side via using your IDE without the remote debug feature.
+- *There are many other ways of debugging PySpark applications*. For example, you can remotely debug by using the open source `Remote Debugger <https://www.pydev.org/manual_adv_remote_debugger.html>`_ instead of using PyCharm Professional documented here.
+
+
+Remote Debugging (PyCharm Professional)
+---------------------------------------
+
+This section describes remote debugging on both driver and executor sides within a single machine to demonstrate easily.
+The ways of debugging PySpark on the executor side is different from doing in the driver. Therefore, they will be demonstrated respectively.
+In order to debug PySpark applications on other machines, please refer to the full instructions that are specific
+to PyCharm, documented `here <https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html>`_.
+
+Firstly, choose **Edit Configuration...** from the *Run* menu. It opens the **Run/Debug Configurations dialog**.
+You have to click ``+`` configuration on the toolbar, and from the list of available configurations, select **Python Debug Server**.
+Enter the name of this new configuration, for example, ``MyRemoteDebugger`` and also specify the port number, for example ``12345``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug1.png
+    :alt: PyCharm remote debugger setting
+
+| After that, you should install the corresponding version of the ``pydevd-pycahrm`` package in all the machines which will connect to your PyCharm debugger. In the previous dialog, it shows the command to install.
+
+.. code-block:: text
+
+    pip install pydevd-pycharm~=<version of PyCharm on the local machine>
+
+Driver Side
+~~~~~~~~~~~
+
+To debug on the driver side, your application should connect to the debugging server. Copy and paste the codes
+with ``pydevd_pycharm.settrace`` to the top of your PySpark script. Suppose the file name is ``app.py``:
+
+.. code-block:: bash
+
+    echo "#======================Copy and paste from the previous dialog===========================
+    import pydevd_pycharm
+    pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)
+    #========================================================================================
+    # Your PySpark application codes:
+    from pyspark.sql import SparkSession
+    spark = SparkSession.builder.getOrCreate()
+    spark.range(10).show()" > app.py
+
+Start debugging with your ``MyRemoteDebugger``.
+
+.. image:: ../../../../docs/img/pyspark-remote-debug2.png
+    :alt: PyCharm run remote debugger
+
+| After that, submit your application. This will connect to your PyCharm debugging server and enable you to debug on driver side remotely.
+
+.. code-block:: bash
+
+    spark-submit app.py
+
+Executor Side
+~~~~~~~~~~~~~
+
+To debug on the executor side, prepare a Python file as below In your current working directory.

Review comment:
       In -> in




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688014191


   **[Test build #128332 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128332/testReport)** for PR 29639 at commit [`8709fb7`](https://github.com/apache/spark/commit/8709fb73ec396390e939d2c5c30eaf7329b482d8).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zero323 commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
zero323 commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483402746



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)

Review comment:
       Can we explicitly state that the remote debugger is available only PyCharm Professional (I know, it is clearly explained in PyCharm docs, but not everyone will get there)? And maybe link to [pydev remote debugger docs](https://www.pydev.org/manual_adv_remote_debugger.html) as an alternative.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688026864






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687024073






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686472391


   FWIW, documenting such setup in a language dedicated page isn't a radical approach. We're already doing it for RStudio and SparkR at https://spark.apache.org/docs/latest/sparkr.html#starting-up-from-rstudio


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687023296


   **[Test build #128290 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128290/testReport)** for PR 29639 at commit [`641eb36`](https://github.com/apache/spark/commit/641eb365597ae5ac2864fe9216d8b8b6901eaf4e).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686456423


   **[Test build #128260 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128260/testReport)** for PR 29639 at commit [`7faae59`](https://github.com/apache/spark/commit/7faae596242f8946c0dc671fd1946f1ba480f9f4).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688019481






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687023296


   **[Test build #128290 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128290/testReport)** for PR 29639 at commit [`641eb36`](https://github.com/apache/spark/commit/641eb365597ae5ac2864fe9216d8b8b6901eaf4e).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687027881






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017081






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017081






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686874895






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686893915






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688566152


   **[Test build #128367 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128367/testReport)** for PR 29639 at commit [`adcbe4f`](https://github.com/apache/spark/commit/adcbe4f5f67dac7d7fdccc6fdde5e987aa104863).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687047198






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686890672


   Thanks @srowen and @viirya.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686895732


   **[Test build #128275 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128275/testReport)** for PR 29639 at commit [`70adf81`](https://github.com/apache/spark/commit/70adf815715405060796b7ff8d34f58149b2d0bb).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686883777


   **[Test build #128273 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128273/testReport)** for PR 29639 at commit [`cea4be4`](https://github.com/apache/spark/commit/cea4be49ad0dfce4622959cc7e8782afd4c90e90).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686474711






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686456991






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687047198






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686874895






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686906378






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688566152


   **[Test build #128367 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128367/testReport)** for PR 29639 at commit [`adcbe4f`](https://github.com/apache/spark/commit/adcbe4f5f67dac7d7fdccc6fdde5e987aa104863).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #29639:
URL: https://github.com/apache/spark/pull/29639#discussion_r483473474



##########
File path: python/docs/source/development/debugging.rst
##########
@@ -0,0 +1,187 @@
+..  Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+..    http://www.apache.org/licenses/LICENSE-2.0
+
+..  Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+=================
+Debugging PySpark
+=================
+
+PySpark uses Spark as an engine. If a PySpark application does not require interaction
+between Python workers and JVMs, Python workers are not launched. They are lazily launched only when
+Python native functions or data have to be handled, for example, when you execute pandas UDFs or
+PySpark RDD APIs.
+
+This page describes how to debug such Python applications and workers instead of focusing on debugging with JVM.
+Profiling and debugging JVM is described at `Useful Developer Tools <https://spark.apache.org/developer-tools.html>`_.
+
+
+Remote Debugging (PyCharm)

Review comment:
       ahhhh .. I didn't know it's only for PyCharm Professional ..




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017936


   Hey guys, sorry for a bit of noise here. Would you guys mind if I ask take another look? I changed a bit a lot while I am addressing @BryanCutler and @zero323 comments.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688019481






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017434






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686884077






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687046566


   **[Test build #128292 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128292/testReport)** for PR 29639 at commit [`ee9fb77`](https://github.com/apache/spark/commit/ee9fb77cd7b51c2ba83cfd85b775c8d372f4ca40).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686893915






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688018881


   **[Test build #128335 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128335/testReport)** for PR 29639 at commit [`8162dfc`](https://github.com/apache/spark/commit/8162dfc5ee6ee761d4362176406350e3250e11f9).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687948686






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687948078


   **[Test build #128329 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128329/testReport)** for PR 29639 at commit [`9a675d3`](https://github.com/apache/spark/commit/9a675d335078164b072e2f2c1c788abfcbc19db6).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688566440






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687948078


   **[Test build #128329 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128329/testReport)** for PR 29639 at commit [`9a675d3`](https://github.com/apache/spark/commit/9a675d335078164b072e2f2c1c788abfcbc19db6).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688017442


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/128332/
   Test FAILed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686906378






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686895732


   **[Test build #128275 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128275/testReport)** for PR 29639 at commit [`70adf81`](https://github.com/apache/spark/commit/70adf815715405060796b7ff8d34f58149b2d0bb).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32783][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686456423


   **[Test build #128260 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128260/testReport)** for PR 29639 at commit [`7faae59`](https://github.com/apache/spark/commit/7faae596242f8946c0dc671fd1946f1ba480f9f4).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687027194


   **[Test build #128292 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128292/testReport)** for PR 29639 at commit [`ee9fb77`](https://github.com/apache/spark/commit/ee9fb77cd7b51c2ba83cfd85b775c8d372f4ca40).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32783][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686456991






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686474031


   **[Test build #128260 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128260/testReport)** for PR 29639 at commit [`7faae59`](https://github.com/apache/spark/commit/7faae596242f8946c0dc671fd1946f1ba480f9f4).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-688026864






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] User Guide - Debugging

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-686874465


   **[Test build #128273 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128273/testReport)** for PR 29639 at commit [`cea4be4`](https://github.com/apache/spark/commit/cea4be49ad0dfce4622959cc7e8782afd4c90e90).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #29639: [SPARK-32186][DOCS][PYTHON] Development - Debugging

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #29639:
URL: https://github.com/apache/spark/pull/29639#issuecomment-687022060


   I'll leave this open for a couple of more days in case there are some more comments.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org