Skip to content

Conversation

@zhenlineo
Copy link
Contributor

@zhenlineo zhenlineo commented Mar 8, 2023

What changes were proposed in this pull request?

The spark-connect script is broken as it need a jar at the end.
Also ensured when scala 2.13 is set, all commands in the scripts runs with -PScala-2.13

Example usage:
Start spark connect with default settings:

  • ./connector/connect/bin/spark-connect-shell
  • or ./connector/connect/bin/spark-connect (Enter "q" to exit the program)

Start Scala client with default settings: ./connector/connect/bin/spark-connect-scala-client

Start spark connect with extra configs:

  • ./connector/connect/bin/spark-connect-shell --conf spark.connect.grpc.binding.port=8888
  • or ./connector/connect/bin/spark-connect --conf spark.connect.grpc.binding.port=8888

Start Scala client with a connection string:

export SPARK_REMOTE="sc://localhost:8888/"
./connector/connect/bin/spark-connect-scala-client

Why are the changes needed?

Bug fix

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manually tested on 2.12 and 2.13 for all the scripts changed.

Test example with expected results:
./connector/connect/bin/spark-connect-shell :
Screen Shot 2023-03-08 at 2 14 31 PM

Verify the spark connect server is started at the correct port, e.g.

>Telnet localhost 15002 
Trying ::1...
Connected to localhost.
Escape character is '^]'.

./connector/connect/bin/spark-connect:
Screen Shot 2023-03-08 at 2 13 09 PM
Server started successfully when seeing the last line output.

./connector/connect/bin/spark-connect-scala-client:
Screen Shot 2023-03-08 at 2 11 58 PM
Verify the client can run some simple quries.

@pan3793
Copy link
Member

pan3793 commented Mar 8, 2023

Manually tested

@zhenlineo would you mind supplying more details about your test steps and results? Actually, I have been trying these scripts since you added them the first time, finally, it success w/ a workaround(by adding an extra parameter spark-internal, I suppose this PR will fix it) after your last update. It would be good if you can leave some commands in your PR description, which makes it easier for reviewers or learners to verify your changes.

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this, I can reproduce your test results by using Java 8 and Scala 2.12.

Copy link
Contributor

@hvanhovell hvanhovell left a comment

Choose a reason for hiding this comment

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

LGTM

@HyukjinKwon
Copy link
Member

Merged to master and branch-3.4.

HyukjinKwon pushed a commit that referenced this pull request Mar 9, 2023
### What changes were proposed in this pull request?
The spark-connect script is broken as it need a jar at the end.
Also ensured when scala 2.13 is set, all commands in the scripts runs with `-PScala-2.13`

Example usage:
Start spark connect with default settings:
* `./connector/connect/bin/spark-connect-shell`
* or `./connector/connect/bin/spark-connect` (Enter "q" <new line> to exit the program)

Start Scala client with default settings: `./connector/connect/bin/spark-connect-scala-client`

Start spark connect with extra configs:
* `./connector/connect/bin/spark-connect-shell --conf spark.connect.grpc.binding.port=8888`
* or `./connector/connect/bin/spark-connect --conf spark.connect.grpc.binding.port=8888`

Start Scala client with a connection string:
```
export SPARK_REMOTE="sc://localhost:8888/"
./connector/connect/bin/spark-connect-scala-client
```

### Why are the changes needed?
Bug fix

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Manually tested on 2.12 and 2.13 for all the scripts changed.

Test example with expected results:
`./connector/connect/bin/spark-connect-shell` :
<img width="1050" alt="Screen Shot 2023-03-08 at 2 14 31 PM" src="https://user-images.githubusercontent.com/4190164/223863343-d5d159d9-da7c-47c7-b55a-a2854c5f5d76.png">

Verify the spark connect server is started at the correct port, e.g.
```
>Telnet localhost 15002
Trying ::1...
Connected to localhost.
Escape character is '^]'.
```

`./connector/connect/bin/spark-connect`:
<img width="1680" alt="Screen Shot 2023-03-08 at 2 13 09 PM" src="https://user-images.githubusercontent.com/4190164/223863099-41195599-c49d-4db4-a1e2-e129a649cd81.png">
Server started successfully when seeing the last line output.

`./connector/connect/bin/spark-connect-scala-client`:
<img width="1658" alt="Screen Shot 2023-03-08 at 2 11 58 PM" src="https://user-images.githubusercontent.com/4190164/223862992-c8a3a36a-9f69-40b8-b82e-5dab85ed14ce.png">
Verify the client can run some simple quries.

Closes #40344 from zhenlineo/fix-scripts.

Authored-by: Zhen Li <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit b5243d7)
Signed-off-by: Hyukjin Kwon <[email protected]>
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
### What changes were proposed in this pull request?
The spark-connect script is broken as it need a jar at the end.
Also ensured when scala 2.13 is set, all commands in the scripts runs with `-PScala-2.13`

Example usage:
Start spark connect with default settings:
* `./connector/connect/bin/spark-connect-shell`
* or `./connector/connect/bin/spark-connect` (Enter "q" <new line> to exit the program)

Start Scala client with default settings: `./connector/connect/bin/spark-connect-scala-client`

Start spark connect with extra configs:
* `./connector/connect/bin/spark-connect-shell --conf spark.connect.grpc.binding.port=8888`
* or `./connector/connect/bin/spark-connect --conf spark.connect.grpc.binding.port=8888`

Start Scala client with a connection string:
```
export SPARK_REMOTE="sc://localhost:8888/"
./connector/connect/bin/spark-connect-scala-client
```

### Why are the changes needed?
Bug fix

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Manually tested on 2.12 and 2.13 for all the scripts changed.

Test example with expected results:
`./connector/connect/bin/spark-connect-shell` :
<img width="1050" alt="Screen Shot 2023-03-08 at 2 14 31 PM" src="https://user-images.githubusercontent.com/4190164/223863343-d5d159d9-da7c-47c7-b55a-a2854c5f5d76.png">

Verify the spark connect server is started at the correct port, e.g.
```
>Telnet localhost 15002
Trying ::1...
Connected to localhost.
Escape character is '^]'.
```

`./connector/connect/bin/spark-connect`:
<img width="1680" alt="Screen Shot 2023-03-08 at 2 13 09 PM" src="https://user-images.githubusercontent.com/4190164/223863099-41195599-c49d-4db4-a1e2-e129a649cd81.png">
Server started successfully when seeing the last line output.

`./connector/connect/bin/spark-connect-scala-client`:
<img width="1658" alt="Screen Shot 2023-03-08 at 2 11 58 PM" src="https://user-images.githubusercontent.com/4190164/223862992-c8a3a36a-9f69-40b8-b82e-5dab85ed14ce.png">
Verify the client can run some simple quries.

Closes apache#40344 from zhenlineo/fix-scripts.

Authored-by: Zhen Li <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit b5243d7)
Signed-off-by: Hyukjin Kwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants