Skip to content
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

update package command for mutil spark version #90

Merged
merged 2 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@

NebulaGraph Spark Connector 2.0/3.0 only supports NebulaGraph 2.x/3.x. If you are using NebulaGraph v1.x, please use [NebulaGraph Spark Connector v1.0](https://github.com/vesoft-inc/nebula-java/tree/v1.0/tools/nebula-spark) .

NebulaGraph Spark Connector support spark 2.2 and 2.4.
NebulaGraph Spark Connector support spark 2.2, 2.4 and 3.0.

## How to Compile

1. Package NebulaGraph Spark Connector.

```bash
$ git clone https://github.com/vesoft-inc/nebula-spark-connector.git
$ cd nebula-spark-connector/nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector -am -Pscala-2.11 -Pspark-2.4
```
if you want to use connector for spark 2.2.x, use the command:
```
$ cd nebula-spark-connector/nebula-spark-connector_2.2
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector_2.2 -am -Pscala-2.11 -Pspark-2.2
```
if you want to use connector for spark 3.x, use the command:
```
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector_3.0 -am -Pscala-2.12 -Pspark-3.0
```

After the packaging, you can see the newly generated nebula-spark-connector-3.0-SNAPSHOT.jar under the nebula-spark-connector/nebula-spark-connector/target/ directory.
Expand Down
23 changes: 16 additions & 7 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@

Nebula Spark Connector 2.0/3.0 仅支持 Nebula Graph 2.x/3.x。如果您正在使用 Nebula Graph v1.x,请使用 [Nebula Spark Connector v1.0](https://github.com/vesoft-inc/nebula-java/tree/v1.0/tools)。

Nebula Spark Connector 支持 Spark 2.22.4.
Nebula Spark Connector 支持 Spark 2.22.4 和 3.x.
## 如何编译

1. 编译打包 Nebula Spark Connector。

```bash
$ git clone https://github.com/vesoft-inc/nebula-spark-connector.git
$ cd nebula-spark-connector/nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true
```
```bash
$ git clone https://github.com/vesoft-inc/nebula-spark-connector.git
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector -am -Pscala-2.11 -Pspark-2.4
```
若想在spark2.2环境中使用connector,请使用如下命令编译:
```
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector_2.2 -am -Pscala-2.11 -Pspark-2.2
```
若想在spark3.0环境中使用connector,请使用如下命令编译:
```
$ cd nebula-spark-connector
$ mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -pl nebula-spark-connector_3.0 -am -Pscala-2.12 -Pspark-3.0
```

编译打包完成后,可以在 nebula-spark-connector/nebula-spark-connector/target/ 目录下看到 nebula-spark-connector-3.0-SNAPSHOT.jar 文件。

若在 spark 2.2 环境中使用 Nebula Spark Connector,请在 nebula-spark-connector_2.2 目录下进行编译。
## 特性

* 提供了更多连接配置项,如超时时间、连接重试次数、执行重试次数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object NebulaSparkReaderExample {
val config =
NebulaConnectionConfig
.builder()
.withMetaAddress("192.168.8.171:9559")
.withMetaAddress("127.0.0.1:9559")
.withConenctionRetry(2)
.build()
val nebulaReadVertexConfig: ReadNebulaConfig = ReadNebulaConfig
Expand All @@ -65,7 +65,7 @@ object NebulaSparkReaderExample {
val config =
NebulaConnectionConfig
.builder()
.withMetaAddress("192.168.8.171:9559")
.withMetaAddress("127.0.0.1:9559")
.withTimeout(6000)
.withConenctionRetry(2)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ object NebulaSparkWriterExample {
val config =
NebulaConnectionConfig
.builder()
.withMetaAddress("192.168.8.171:9559")
.withGraphAddress("192.168.8.171:9669")
.withMetaAddress("127.0.0.1:9559")
.withGraphAddress("127.0.0.1:9669")
.withConenctionRetry(2)
.build()
val nebulaWriteVertexConfig: WriteNebulaVertexConfig = WriteNebulaVertexConfig
Expand Down