Skip to content

Conversation

@leoluan2009
Copy link
Contributor

Why are the changes needed?

Submit pyspark batch job by restful api

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2022

Codecov Report

Merging #3836 (357691c) into master (6bf4e49) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

❗ Current head 357691c differs from pull request most recent head 550021a. Consider uploading reports for the commit 550021a to get more accurate results

@@             Coverage Diff              @@
##             master    #3836      +/-   ##
============================================
- Coverage     52.97%   52.94%   -0.04%     
  Complexity       13       13              
============================================
  Files           497      497              
  Lines         28022    28029       +7     
  Branches       3863     3867       +4     
============================================
- Hits          14845    14839       -6     
- Misses        11781    11784       +3     
- Partials       1396     1406      +10     
Impacted Files Coverage Δ
...pache/kyuubi/engine/KyuubiApplicationManager.scala 82.60% <0.00%> (-1.22%) ⬇️
...g/apache/kyuubi/operation/BatchJobSubmission.scala 74.64% <0.00%> (ø)
.../apache/kyuubi/server/api/v1/BatchesResource.scala 68.84% <33.33%> (-0.35%) ⬇️
...in/scala/org/apache/kyuubi/config/KyuubiConf.scala 97.41% <75.00%> (-0.14%) ⬇️
...ache/kyuubi/engine/spark/SparkProcessBuilder.scala 86.81% <100.00%> (+0.14%) ⬆️
...uubi/engine/spark/events/SparkOperationEvent.scala 88.88% <0.00%> (-5.56%) ⬇️
...rg/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala 63.93% <0.00%> (-1.64%) ⬇️
...apache/kyuubi/session/KyuubiBatchSessionImpl.scala 90.66% <0.00%> (-1.23%) ⬇️
...yuubi/server/metadata/jdbc/JDBCMetadataStore.scala 89.27% <0.00%> (-0.70%) ⬇️
...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala 80.74% <0.00%> (-0.63%) ⬇️
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@turboFei turboFei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@turboFei turboFei requested a review from pan3793 November 23, 2022 01:37
@turboFei turboFei added this to the v1.6.2 milestone Nov 23, 2022
@leoluan2009 leoluan2009 changed the title [WIP] Support pyspark batch job by restful api Support pyspark batch job by restful api Nov 23, 2022
@leoluan2009 leoluan2009 changed the title Support pyspark batch job by restful api [SPARK] Support pyspark batch job by restful api Nov 23, 2022
@pan3793
Copy link
Member

pan3793 commented Nov 23, 2022

Do we have a chance to add a test?

@pan3793 pan3793 modified the milestones: v1.6.2, v1.7.0 Nov 24, 2022
@pan3793
Copy link
Member

pan3793 commented Nov 24, 2022

Thanks, merged to master. (It's a new feature, I changed the milestone from 1.6.2 to 1.7.0)

@pan3793 pan3793 closed this in 00d2d2e Nov 24, 2022
minyk pushed a commit to nexr/kyuubi that referenced this pull request Mar 9, 2023
### _Why are the changes needed?_

Submit pyspark batch job by restful api

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes apache#3836 from leoluan2009/pyspark-1.

Closes apache#3836

550021a [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KyuubiApplicationManager.scala
357691c [Xuedong Luan] fix comment
7dfdbe2 [Xuedong Luan] fix comment
31bda17 [Xuedong Luan] [WIP] Support pyspark batch job by restful api

Lead-authored-by: Xuedong Luan <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit 00d2d2e)
bowenliang123 added a commit that referenced this pull request Oct 24, 2023
### _Why are the changes needed?_

To close #5380.

As PySpark jobs become popular approach for data exploring and processing, we need to create tests for creating PySpark jobs.

According the existing Spark Jar unit tests, two PySpark job unit test were added, they are all simple PI computing jobs from Spark examples.

#### case1, "pyspark submit - basic batch rest client with existing resource file"
It's almost same with the spark jar job test case, except the following two points:
1. param `batchType` should be set to `PYSPARK`, not `SPARK`.  please refer to #3836 for detailed information.
2. For PySpark job,param `className` is useless, should be set to null

#### case2, "pyspark submit - basic batch rest client with uploading resource file"

Through the two test cases, simple PySpark jobs can be submitted normally.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No

Closes #5498 from weixi62961/unittest-batchapi-pyspark-simple.

Closes #5380

b693efc [Bowen Liang] simplify sparkBatchTestResource
72a92b5 [Bowen Liang] Update kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/PySparkBatchRestApiSuite.scala
b2035a3 [weixi] remove no necessary wrapper object "PySparkJobPI"
27d12e8 [weixi] rename from BatchRestApiPySparkSuite to PySparkBatchRestApiSuite
e680e60 [weixi] Create a dedicated batch API suite for PySpark jobs.
dc8b6bf [weixi] add 2 test cases for pyspark batch job submit.

Lead-authored-by: weixi <[email protected]>
Co-authored-by: Bowen Liang <[email protected]>
Co-authored-by: Bowen Liang <[email protected]>
Signed-off-by: liangbowen <[email protected]>
bowenliang123 added a commit that referenced this pull request Oct 25, 2023
### _Why are the changes needed?_

To close #5380.

As PySpark jobs become popular approach for data exploring and processing, we need to create tests for creating PySpark jobs.

According the existing Spark Jar unit tests, two PySpark job unit test were added, they are all simple PI computing jobs from Spark examples.

#### case1, "pyspark submit - basic batch rest client with existing resource file"
It's almost same with the spark jar job test case, except the following two points:
1. param `batchType` should be set to `PYSPARK`, not `SPARK`.  please refer to #3836 for detailed information.
2. For PySpark job,param `className` is useless, should be set to null

#### case2, "pyspark submit - basic batch rest client with uploading resource file"

Through the two test cases, simple PySpark jobs can be submitted normally.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No

Closes #5498 from weixi62961/unittest-batchapi-pyspark-simple.

Closes #5380

b693efc [Bowen Liang] simplify sparkBatchTestResource
72a92b5 [Bowen Liang] Update kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/PySparkBatchRestApiSuite.scala
b2035a3 [weixi] remove no necessary wrapper object "PySparkJobPI"
27d12e8 [weixi] rename from BatchRestApiPySparkSuite to PySparkBatchRestApiSuite
e680e60 [weixi] Create a dedicated batch API suite for PySpark jobs.
dc8b6bf [weixi] add 2 test cases for pyspark batch job submit.

Lead-authored-by: weixi <[email protected]>
Co-authored-by: Bowen Liang <[email protected]>
Co-authored-by: Bowen Liang <[email protected]>
Signed-off-by: liangbowen <[email protected]>
(cherry picked from commit 5cff4fb)
Signed-off-by: liangbowen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants