Skip to content

Commit

Permalink
[Feature]: Support reading and writing oceanbase via JDBC or direct-l…
Browse files Browse the repository at this point in the history
…oad api (#3)

* feat: Introducing new feature: Spark Connector OceanBase.

* Enhancement: Bug fix.

* Enhancement: Fix doc.

* Enhancement: Fix doc.
  • Loading branch information
yuanoOo authored Nov 11, 2024
1 parent 508c67f commit dcf1af2
Show file tree
Hide file tree
Showing 47 changed files with 5,663 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build

on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- '.*'
push:
branches:
- main
- 'release-*'

env:
JDK_VERSION: 8

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: 'adopt'
cache: 'maven'

- name: Build and Test
timeout-minutes: 60
run: mvn clean package
70 changes: 70 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
runner.dialect = scala212

# Version is required to make sure IntelliJ picks the right version
version = 3.4.3
preset = default

# Max column
maxColumn = 100

# This parameter simply says the .stripMargin method was not redefined by the user to assign
# special meaning to indentation preceding the | character. Hence, that indentation can be modified.
assumeStandardLibraryStripMargin = true
align.stripMargin = true

# Align settings
align.preset = none
align.closeParenSite = false
align.openParenCallSite = false
danglingParentheses.defnSite = false
danglingParentheses.callSite = false
danglingParentheses.ctrlSite = true
danglingParentheses.tupleSite = false
align.openParenCallSite = false
align.openParenDefnSite = false
align.openParenTupleSite = false

# Newlines
newlines.alwaysBeforeElseAfterCurlyIf = false
newlines.beforeCurlyLambdaParams = multiline # Newline before lambda params
newlines.afterCurlyLambdaParams = squash # No newline after lambda params
newlines.inInterpolation = "avoid"
newlines.avoidInResultType = true
optIn.annotationNewlines = true

# Scaladoc
docstrings.style = Asterisk # Javadoc style
docstrings.removeEmpty = true
docstrings.oneline = fold
docstrings.forceBlankLineBefore = true

# Indentation
indent.extendSite = 2 # This makes sure extend is not indented as the ctor parameters

# Rewrites
rewrite.rules = [AvoidInfix, Imports, RedundantBraces, SortModifiers]

# Imports
rewrite.imports.sort = scalastyle
rewrite.imports.groups = [
["com.oceanbase\\..*"],
["com.oceanbase.shade\\..*"],
[".*"],
["javax\\..*"],
["java\\..*"],
["scala\\..*"]
]
rewrite.imports.contiguousGroups = no
importSelectors = singleline # Imports in a single line, like IntelliJ

# Remove redundant braces in string interpolation.
rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.defnBodies = false
rewrite.redundantBraces.generalExpressions = false
rewrite.redundantBraces.ifElseExpressions = false
rewrite.redundantBraces.methodBodies = false
rewrite.redundantBraces.includeUnitMethods = false
rewrite.redundantBraces.maxBreaks = 1

# Remove trailing commas
rewrite.trailingCommas.style = "never"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ English | [简体中文](README_CN.md)

## Features

Coming soon...
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) |

## Community

Expand Down
6 changes: 5 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

## 功能

即将推出...
本仓库提供了如下 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) |

## 社区

Expand Down
Loading

0 comments on commit dcf1af2

Please sign in to comment.