diff --git a/README.md b/README.md index 6f0df1e4..a1537637 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ 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 @@ -13,13 +13,18 @@ NebulaGraph Spark Connector support spark 2.2 and 2.4. ```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. diff --git a/README_CN.md b/README_CN.md index d3db0938..7dc9247d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -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.2 和 2.4. +Nebula Spark Connector 支持 Spark 2.2, 2.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 目录下进行编译。 ## 特性 * 提供了更多连接配置项,如超时时间、连接重试次数、执行重试次数 diff --git a/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkReaderExample.scala b/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkReaderExample.scala index 3d5a07d2..cdb67a4e 100644 --- a/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkReaderExample.scala +++ b/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkReaderExample.scala @@ -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 @@ -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() diff --git a/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkWriterExample.scala b/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkWriterExample.scala index ccde7fdf..031a0c21 100644 --- a/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkWriterExample.scala +++ b/example/src/main/scala/com/vesoft/nebula/examples/connector/NebulaSparkWriterExample.scala @@ -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