-
Notifications
You must be signed in to change notification settings - Fork 936
[WIP] Kyuubi Connect #6642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
pan3793
wants to merge
9
commits into
apache:master
Choose a base branch
from
pan3793:kyuubi-next
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WIP] Kyuubi Connect #6642
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
beedc97
Revise `scala-2.12` and `scala-2.13` maven profiles
pan3793 9964c9b
Scala 2.13 by default
pan3793 fd8805b
Spark 4 by default
pan3793 7cdc63e
A quicky demo for Kyuubi Connect
pan3793 860aeae
docs
pan3793 fd0cfc1
spark-4.0.0-preview2
pan3793 dedf238
log4j-slf4j2-impl
pan3793 e8eb156
disable delta test
pan3793 a12b76b
IDEA-93855
pan3793 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!-- | ||
- 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. | ||
--> | ||
|
||
Kyuubi Connect | ||
============== | ||
|
||
### Source Code under development | ||
|
||
``` | ||
git clone https://github.com/pan3793/kyuubi.git -b kyuubi-next kyuubi-next | ||
``` | ||
|
||
### Requirements | ||
|
||
- `JAVA_HOME` points to Java 17 | ||
- `SPARK_HOME` points to `/path/of/spark-4.0.0-preview2-bin-hadoop3` | ||
|
||
### Run | ||
|
||
#### Run within IDEA | ||
|
||
- Run `build/mvn clean install -DskipTests` to build the project and produce the Spark engine jar | ||
- Run `kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala` using IDEA | ||
|
||
You can set `SPARK_HOME`, `KYUUBI_CONF_DIR` in the Run/Debug Configuration Dialog | ||
|
||
 | ||
|
||
#### Run within Terminal | ||
|
||
``` | ||
build/dist | ||
cd dist | ||
bin/kyuubi run --conf kyuubi.frontend.grpc.bind.port=10999 | ||
``` | ||
|
||
The gRPC service listens 10999 by default. | ||
|
||
### Connect to Kyuubi Connect | ||
|
||
Spark Connect Scala client (Requires: Java 17, Spark 4.0.0-preview2) | ||
``` | ||
cd /path/of/spark-4.0.0-preview2-bin-hadoop3 | ||
bin/spark-shell --remote sc://H27212-MAC-01.local:10999 --user_id chengpan --user_name chengpan | ||
``` | ||
|
||
PySpark Connect client (Requires: Python >=3.9) | ||
``` | ||
pip install pyspark-connect==4.0.0.dev2 | ||
pyspark --remote sc://H27212-MAC-01.local:10999 --user_id chengpan --user_name chengpan | ||
``` | ||
|
||
Run examples | ||
``` | ||
Welcome to | ||
____ __ | ||
/ __/__ ___ _____/ /__ | ||
_\ \/ _ \/ _ `/ __/ '_/ | ||
/___/ .__/\_,_/_/ /_/\_\ version 4.0.0-preview2 | ||
/_/ | ||
|
||
Type in expressions to have them evaluated. | ||
Spark session available as 'spark'. | ||
|
||
scala> spark.sql("select 1").show() | ||
+---+ | ||
| 1| | ||
+---+ | ||
| 1| | ||
+---+ | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...rk-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkGrpcBackendService.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
package org.apache.kyuubi.engine.spark | ||
|
||
import org.apache.spark.sql.SparkSession | ||
|
||
import org.apache.kyuubi.engine.spark.session.SparkSQLSessionManager | ||
import org.apache.kyuubi.service.AbstractBackendService | ||
import org.apache.kyuubi.session.SessionManager | ||
|
||
/** | ||
* A [[org.apache.kyuubi.service.BackendService]] constructed | ||
* with [[SparkSession]] which give it the ability to talk with | ||
* Spark and let Spark do all the rest heavy work :) | ||
* | ||
* @param name Service Name | ||
* @param spark A [[SparkSession]] instance | ||
* that this backend service holds to run [[org.apache.kyuubi.operation.Operation]]s. | ||
*/ | ||
class SparkGrpcBackendService(name: String, spark: SparkSession) | ||
extends AbstractBackendService(name) { | ||
|
||
def this(spark: SparkSession) = this(classOf[SparkGrpcBackendService].getSimpleName, spark) | ||
|
||
override val sessionManager: SessionManager = new SparkSQLSessionManager(spark) | ||
|
||
def sparkSession: SparkSession = spark | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly, that this class is not used at all and we just start the SparkConnect gRPC server in the
SparkGrpcFrontendService
?