Skip to content

Commit dcf1af2

Browse files
authored
[Feature]: Support reading and writing oceanbase via JDBC or direct-load api (#3)
* feat: Introducing new feature: Spark Connector OceanBase. * Enhancement: Bug fix. * Enhancement: Fix doc. * Enhancement: Fix doc.
1 parent 508c67f commit dcf1af2

File tree

47 files changed

+5663
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5663
-2
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**.md'
8+
- '.*'
9+
push:
10+
branches:
11+
- main
12+
- 'release-*'
13+
14+
env:
15+
JDK_VERSION: 8
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up JDK ${{ env.JDK_VERSION }}
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: ${{ env.JDK_VERSION }}
33+
distribution: 'adopt'
34+
cache: 'maven'
35+
36+
- name: Build and Test
37+
timeout-minutes: 60
38+
run: mvn clean package

.scalafmt.conf

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
runner.dialect = scala212
2+
3+
# Version is required to make sure IntelliJ picks the right version
4+
version = 3.4.3
5+
preset = default
6+
7+
# Max column
8+
maxColumn = 100
9+
10+
# This parameter simply says the .stripMargin method was not redefined by the user to assign
11+
# special meaning to indentation preceding the | character. Hence, that indentation can be modified.
12+
assumeStandardLibraryStripMargin = true
13+
align.stripMargin = true
14+
15+
# Align settings
16+
align.preset = none
17+
align.closeParenSite = false
18+
align.openParenCallSite = false
19+
danglingParentheses.defnSite = false
20+
danglingParentheses.callSite = false
21+
danglingParentheses.ctrlSite = true
22+
danglingParentheses.tupleSite = false
23+
align.openParenCallSite = false
24+
align.openParenDefnSite = false
25+
align.openParenTupleSite = false
26+
27+
# Newlines
28+
newlines.alwaysBeforeElseAfterCurlyIf = false
29+
newlines.beforeCurlyLambdaParams = multiline # Newline before lambda params
30+
newlines.afterCurlyLambdaParams = squash # No newline after lambda params
31+
newlines.inInterpolation = "avoid"
32+
newlines.avoidInResultType = true
33+
optIn.annotationNewlines = true
34+
35+
# Scaladoc
36+
docstrings.style = Asterisk # Javadoc style
37+
docstrings.removeEmpty = true
38+
docstrings.oneline = fold
39+
docstrings.forceBlankLineBefore = true
40+
41+
# Indentation
42+
indent.extendSite = 2 # This makes sure extend is not indented as the ctor parameters
43+
44+
# Rewrites
45+
rewrite.rules = [AvoidInfix, Imports, RedundantBraces, SortModifiers]
46+
47+
# Imports
48+
rewrite.imports.sort = scalastyle
49+
rewrite.imports.groups = [
50+
["com.oceanbase\\..*"],
51+
["com.oceanbase.shade\\..*"],
52+
[".*"],
53+
["javax\\..*"],
54+
["java\\..*"],
55+
["scala\\..*"]
56+
]
57+
rewrite.imports.contiguousGroups = no
58+
importSelectors = singleline # Imports in a single line, like IntelliJ
59+
60+
# Remove redundant braces in string interpolation.
61+
rewrite.redundantBraces.stringInterpolation = true
62+
rewrite.redundantBraces.defnBodies = false
63+
rewrite.redundantBraces.generalExpressions = false
64+
rewrite.redundantBraces.ifElseExpressions = false
65+
rewrite.redundantBraces.methodBodies = false
66+
rewrite.redundantBraces.includeUnitMethods = false
67+
rewrite.redundantBraces.maxBreaks = 1
68+
69+
# Remove trailing commas
70+
rewrite.trailingCommas.style = "never"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ English | [简体中文](README_CN.md)
66

77
## Features
88

9-
Coming soon...
9+
This repository contains connectors as following:
10+
11+
| Connector | Description | Document |
12+
|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
13+
| 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) |
1014

1115
## Community
1216

README_CN.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
## 功能
88

9-
即将推出...
9+
本仓库提供了如下 Connector:
10+
11+
| Connector | 描述 | 使用文档 |
12+
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
13+
| Spark Connector: OceanBase | 该Connector可以通过JDBC驱动或[旁路导入](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001428636)API将数据写入OceanBase。 | [Sink](docs/spark-connector-oceanbase_cn.md) |
1014

1115
## 社区
1216

0 commit comments

Comments
 (0)