Skip to content

Commit

Permalink
fix: add more msg in spark connector (#2446)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagetablechicken authored Sep 8, 2022
1 parent e69ce08 commit 3ebcc7b
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/zh/developer/sdk_develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,18 @@ DBSDK有分为Cluster和Standalone两种,因此也可连接两种OpenMLDB服
这种方式方便用户额外地读取操作元数据,否则DBSDK在SQLClusterRouter内部不会对外暴露。

例如,由于CLI可以直接通过DBSDK获得nameserver等元数据信息,我们在启动ClusterSQLClient或StandAloneSQLClient时是先创建BDSDK再创建SQLClusterRouter。

## Java Test

如果希望只在submodule中测试,可能会需要其他submodule依赖,比如openmldb-spark-connector依赖openmldb-jdbc。你需要先install编译好的包
```
make SQL_JAVASDK_ENABLE=ON
# 或者
cd java
mvn install -DskipTests=true -Dscalatest.skip=true -Dwagon.skip=true -Dmaven.test.skip=true -Dgpg.skip
```
然后再
```
mvn test -pl openmldb-spark-connector -Dsuites=com._4paradigm.openmldb.spark.TestWrite
```
P.S. 如果你实时改动了代码,由于install到本地仓库存在之前的代码编译的jar包,会导致无法测试最新代码。请谨慎使用`-pl`的写法。
50 changes: 50 additions & 0 deletions java/openmldb-spark-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,54 @@
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
</plugin>
<!-- Build site report -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
</plugin>

<!-- Check Java style -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void write(InternalRow record) throws IOException {
addRow(record, preparedStatement);
preparedStatement.addBatch();
} catch (Exception e) {
throw new IOException("convert to openmldb row failed", e);
throw new IOException("convert to openmldb row failed on " + record + ", err: "+ e, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

package com._4paradigm.openmldb.spark

import java.lang.Thread.currentThread

import com._4paradigm.openmldb.sdk.SdkOption
Expand Down

0 comments on commit 3ebcc7b

Please sign in to comment.