You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/06 09:19:37 UTC

[GitHub] [airflow] stijndehaes opened a new pull request #8730: Update spark submit operator for spark 3 support

stijndehaes opened a new pull request #8730:
URL: https://github.com/apache/airflow/pull/8730


   In spark 3 they log the exit code with a lowercase
   e, in spark 2 they used an uppercase E.
   
   Also made the exception a bit clearer when running
   on kubernetes.
   
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [x] Description above provides context of the change
   - [x] Unit tests coverage for changes (not needed for documentation changes)
   - [ ] Target Github ISSUE in description if exists
   - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [x] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


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



[GitHub] [airflow] stale[bot] commented on pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#issuecomment-657057206


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
   


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



[GitHub] [airflow] stijndehaes commented on a change in pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
stijndehaes commented on a change in pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#discussion_r458532937



##########
File path: airflow/providers/apache/spark/hooks/spark_submit.py
##########
@@ -421,11 +421,18 @@ def submit(self, application="", **kwargs):
         # Check spark-submit return code. In Kubernetes mode, also check the value
         # of exit code in the log, as it may differ.
         if returncode or (self._is_kubernetes and self._spark_exit_code != 0):
-            raise AirflowException(
-                "Cannot execute: {}. Error code is: {}.".format(
-                    self._mask_cmd(spark_submit_cmd), returncode
+            if self._is_kubernetes:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}.".format(
+                        self._mask_cmd(spark_submit_cmd), returncode
+                    )
+                )
+            else:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}. Kubernetes spark exit code is: {}".format(

Review comment:
       Thanks for catching that will update the PR




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



[GitHub] [airflow] TeddyHartanto commented on pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
TeddyHartanto commented on pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#issuecomment-662376813


   Thank you! @stijndehaes @kaxil 


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



[GitHub] [airflow] kaxil commented on pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#issuecomment-662340575


   Thanks for the fix @stijndehaes 


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



[GitHub] [airflow] stijndehaes commented on pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
stijndehaes commented on pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#issuecomment-657371020


   This issue is still very relevant more so with the official release of spark 3.0


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

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



[GitHub] [airflow] kaxil commented on a change in pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #8730:
URL: https://github.com/apache/airflow/pull/8730#discussion_r458114477



##########
File path: airflow/providers/apache/spark/hooks/spark_submit.py
##########
@@ -421,11 +421,18 @@ def submit(self, application="", **kwargs):
         # Check spark-submit return code. In Kubernetes mode, also check the value
         # of exit code in the log, as it may differ.
         if returncode or (self._is_kubernetes and self._spark_exit_code != 0):
-            raise AirflowException(
-                "Cannot execute: {}. Error code is: {}.".format(
-                    self._mask_cmd(spark_submit_cmd), returncode
+            if self._is_kubernetes:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}.".format(
+                        self._mask_cmd(spark_submit_cmd), returncode
+                    )
+                )
+            else:
+                raise AirflowException(
+                    "Cannot execute: {}. Error code is: {}. Kubernetes spark exit code is: {}".format(

Review comment:
       Why does this say "Kubernetes Spark". This is in the else so this is not Spark on K8s, isn't 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



[GitHub] [airflow] kaxil merged pull request #8730: Update spark submit operator for spark 3 support

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #8730:
URL: https://github.com/apache/airflow/pull/8730


   


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