diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 9104431..3dc1457 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -21,6 +21,11 @@ jobs: with: module: spark-connector-oceanbase/spark-connector-oceanbase-base + spark-connector-obkv-hbase: + uses: ./.github/workflows/test.yml + with: + module: spark-connector-obkv-hbase/spark-connector-obkv-hbase-base + e2e-tests: strategy: matrix: diff --git a/README.md b/README.md index b28ab7c..2850fa3 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,10 @@ English | [简体中文](README_CN.md) This repository contains connectors as following: -| Connector | Description | Document | -|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| -| Spark Connector: OceanBase | This Connector uses the JDBC driver or the [direct load](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001375568) API to write data to OceanBase. | [Sink](docs/spark-connector-oceanbase.md) | +| Connector | Description | Document | +|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------| +| Spark Connector: OceanBase | This Connector uses the JDBC driver or the [direct load](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001375568) API to write data to OceanBase. | [Read & Write](docs/spark-connector-oceanbase.md) | +| Spark Connector: OBKV HBase | This Connector uses the [OBKV HBase API](https://github.com/oceanbase/obkv-hbase-client-java) to write data to OceanBase. | [Write](docs/spark-connector-obkv-hbase.md) | ## Community diff --git a/README_CN.md b/README_CN.md index 52fde47..cd12cb7 100644 --- a/README_CN.md +++ b/README_CN.md @@ -8,9 +8,10 @@ 本仓库提供了如下 Connector: -| Connector | 描述 | 使用文档 | -|----------------------------|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------| -| Spark Connector: OceanBase | 该Connector可以通过JDBC驱动或[旁路导入](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001428636)API将数据写入OceanBase。 | [Sink](docs/spark-connector-oceanbase_cn.md) | +| Connector | 描述 | 使用文档 | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------| +| Spark Connector: OceanBase | 该Connector可以通过JDBC驱动或[旁路导入](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001428636)API将数据写入OceanBase。 | [Read & Write](docs/spark-connector-oceanbase_cn.md) | +| Spark Connector: OBKV HBase | 该Connector通过[OBKV HBase API](https://github.com/oceanbase/obkv-hbase-client-java)将数据写入OceanBase。 | [Write](docs/spark-connector-obkv-hbase_cn.md) | ## 社区 diff --git a/docs/spark-connector-obkv-hbase.md b/docs/spark-connector-obkv-hbase.md new file mode 100644 index 0000000..da334c3 --- /dev/null +++ b/docs/spark-connector-obkv-hbase.md @@ -0,0 +1,357 @@ +## Spark Connector OBKV HBase + +English | [简体中文](spark-connector-obkv-hbase_cn.md) + +This is the spark connector for OBKV HBase mode, which can be used to write data to OceanBase via [obkv-hbase-client-java](https://github.com/oceanbase/obkv-hbase-client-java). + +## Version compatibility + +
Connector | +Spark | +OceanBase | +Java | +Scala | +
---|---|---|---|---|
1.0 | +2.4, 3.1 ~ 3.4 | +4.2.x or later versions | +8 | +2.12 | +
Option | +Required | +Default | +Type | +Description | +
---|---|---|---|---|
schema-name | +Yes | ++ | String | +The database name of OceanBase. | +
table-name | +Yes | ++ | String | +The table name of HBase, note that the table name in OceanBase is hbase_table_name$family_name . |
+
username | +Yes | ++ | String | +The username of non-sys tenant user. | +
password | +Yes | ++ | String | +The password of non-sys tenant user. | +
schema | +Yes | ++ | String | +The custom JSON format schema supports JSON single quote and double quote modes. When using Spark-SQL, the single quote mode does not need to escape double quotes, which is more convenient.
+
|
+
odp-mode | +No | +false | +Boolean | +If set to 'true', the connector will connect to OBKV via ODP, otherwise via config url. | +
url | +No | ++ | String | +The config url, can be queried by SHOW PARAMETERS LIKE 'obconfig_url' . Required when 'odp-mode' is set to 'false'. |
+
sys.username | +No | ++ | String | +The username of sys tenant. Required if 'odp-mode' is set to 'false'. | +
sys.password | +No | ++ | String | +The password of sys tenant. Required if 'odp-mode' is set to 'false'. | +
odp-ip | +No | ++ | String | +IP address of the ODP. Required if 'odp-mode' is set to 'true'. | +
odp-port | +No | +2885 | +Integer | +RPC port of ODP. Required if 'odp-mode' is set to 'true'. | +
hbase.properties | +No | ++ | String | +Properties to configure 'obkv-hbase-client-java', multiple values are separated by semicolons. | +
batch-size | +No | +10000 | +Integer | +The size of the batch that is written to the OceanBase at one time. | +
Connector | +Spark | +OceanBase | +Java | +Scala | +
---|---|---|---|---|
1.0 | +2.4, 3.1 ~ 3.4 | +4.2.x及以后的版本 | +8 | +2.12 | +
参数名 | +是否必需 | +默认值 | +类型 | +描述 | +
---|---|---|---|---|
schema-name | +是 | ++ | String | +OceanBase 的 db 名。 | +
table-name | +是 | ++ | String | +HBase 表名,注意在 OceanBase 中表名的结构是 hbase_table_name$family_name 。 |
+
username | +是 | ++ | String | +非 sys 租户的用户名。 | +
password | +是 | ++ | String | +非 sys 租户的密码。 | +
schema | +Yes | ++ | String | +自定义的JSON格式Schema,支持JSON单引号和双引号模式,使用Spark-SQL时,单引号模式无需对双引号进行转义,更为方便。
+
|
+
odp-mode | +否 | +false | +Boolean | +如果设置为 'true',连接器将通过 ODP 连接到 OBKV,否则通过 config url 连接。 | +
url | +否 | ++ | String | +集群的 config url,可以通过 SHOW PARAMETERS LIKE 'obconfig_url' 查询。当 'odp-mode' 为 'false' 时必填。 |
+
sys.username | +否 | ++ | String | +sys 租户的用户名,当 'odp-mode' 为 'false' 时必填。 | +
sys.password | +否 | ++ | String | +sys 租户用户的密码,当 'odp-mode' 为 'false' 时必填。 | +
odp-ip | +否 | ++ | String | +ODP 的 IP,当 'odp-mode' 为 'true' 时必填。 | +
odp-port | +否 | +2885 | +Integer | +ODP 的 RPC 端口,当 'odp-mode' 为 'true' 时必填。 | +
hbase.properties | +否 | ++ | String | +配置 'obkv-hbase-client-java' 的属性,多个值用分号分隔。 | +
batch-size | +否 | +10000 | +Integer | +一次写入OceanBase的批大小。 | +