-
Notifications
You must be signed in to change notification settings - Fork 180
[FLINK-37737] Add support for GaussDB database type #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Tyhoning
wants to merge
11
commits into
apache:main
Choose a base branch
from
Tyhoning:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
03e5fa9
Add support for GaussDB database type
Tyhoning e6d1957
Add gaussdb module
Tyhoning e31b475
Adjust the dependencies of the gaussdb pom file.
Tyhoning 153fb02
Adjust the test image of the gaussdb and add license header.
Tyhoning c430009
Merge branch 'apache:main' into main
Tyhoning 9b93d7c
sync vcs.xml
Tyhoning 480e1f4
Merge remote-tracking branch 'origin/main'
Tyhoning c62d0c6
Explain the integration of Gaussian DB source code
Tyhoning d3fa961
Architecture module integrates Gaussian database
Tyhoning 872c3ce
Optimize the features of GaussDB database
Tyhoning f8f9766
Merge remote-tracking branch 'origin/main'
Tyhoning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-connector-jdbc-parent</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>flink-connector-jdbc-gaussdb</artifactId> | ||
Tyhoning marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<name>Flink : Connectors : JDBC : GaussDB</name> | ||
|
||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<gaussdb.version>506.0.0.b058-jdk7</gaussdb.version> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-connector-jdbc-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-connector-jdbc-core</artifactId> | ||
<version>${project.version}</version> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-common</artifactId> | ||
<version>${flink.version}</version> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-api-java-bridge</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-planner_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-planner_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-test-utils</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Gaussdb --> | ||
<dependency> | ||
<groupId>com.huaweicloud.gaussdb</groupId> | ||
<artifactId>gaussdbjdbc</artifactId> | ||
<version>506.0.0.b058-jdk7</version> | ||
<!-- <scope>provided</scope>--> | ||
</dependency> | ||
|
||
<!-- Assertions test dependencies --> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>${assertj.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>jdbc</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test-jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
56 changes: 56 additions & 0 deletions
56
...aussdb/src/main/java/org/apache/flink/connector/jdbc/gaussdb/database/GaussdbFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.connector.jdbc.gaussdb.database; | ||
|
||
import org.apache.flink.annotation.Internal; | ||
import org.apache.flink.connector.jdbc.core.database.JdbcFactory; | ||
import org.apache.flink.connector.jdbc.core.database.catalog.JdbcCatalog; | ||
import org.apache.flink.connector.jdbc.core.database.dialect.JdbcDialect; | ||
import org.apache.flink.connector.jdbc.gaussdb.database.catalog.GaussdbCatalog; | ||
import org.apache.flink.connector.jdbc.gaussdb.database.dialect.GaussdbDialect; | ||
|
||
/** | ||
* Factory for {@link GaussdbDialect}. | ||
* | ||
* <p>Notes: The source code is based on PostgresFactory. | ||
*/ | ||
@Internal | ||
public class GaussdbFactory implements JdbcFactory { | ||
@Override | ||
public boolean acceptsURL(String url) { | ||
return url.startsWith("jdbc:gaussdb:"); | ||
} | ||
|
||
@Override | ||
public JdbcDialect createDialect() { | ||
return new GaussdbDialect(); | ||
} | ||
|
||
@Override | ||
public JdbcCatalog createCatalog( | ||
ClassLoader classLoader, | ||
String catalogName, | ||
String defaultDatabase, | ||
String username, | ||
String pwd, | ||
String baseUrl) { | ||
return new GaussdbCatalog( | ||
classLoader, catalogName, defaultDatabase, username, pwd, baseUrl); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.