-
Notifications
You must be signed in to change notification settings - Fork 2k
[Catalog][DM][Improve] dm catalog and dm auto create table and auto create table add constraintKey #5572
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
Closed
XiaoJiang521
wants to merge
37
commits into
apache:dev
from
XiaoJiang521:dev_dm_udpdate_gettablename
+1,202
−148
Closed
[Catalog][DM][Improve] dm catalog and dm auto create table and auto create table add constraintKey #5572
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
5db48e0
[imporve] dm use schema and table
XiaoJiang521 7cf5b1d
[imporve] create table add constraintKey and dm catalog
XiaoJiang521 da997b7
Merge branch 'dev' into dev_dm_udpdate_gettablename
XiaoJiang521 81a43ff
[imporve] Key update union Key
XiaoJiang521 ca12c4d
Merge branch 'dev' into dev_dm_udpdate_gettablename
XiaoJiang521 e377735
[e2e] Add dm catalog e2e
XiaoJiang521 1b25e64
[e2e] Add dm catalog e2e
XiaoJiang521 636e3b7
[e2e] Add dm catalog e2e
XiaoJiang521 39b30bc
[e2e] remove ""
XiaoJiang521 9c1668f
[e2e] add (
XiaoJiang521 89220e5
[e2e]
XiaoJiang521 12ffa74
[e2e] update dameng catalog
XiaoJiang521 88334c6
[e2e] add dm driver
XiaoJiang521 0b938a3
[e2e] e2e
XiaoJiang521 23dec25
[e2e] info
XiaoJiang521 cc28215
[e2e] update conf
XiaoJiang521 9ebdf58
Merge branch 'dev' into dev_dm_udpdate_gettablename
XiaoJiang521 3561491
[e2e] update
XiaoJiang521 15f4111
[e2e] update
XiaoJiang521 4ae253d
[e2e] order
XiaoJiang521 2de8d35
[e2e] create testuser
XiaoJiang521 547e6e0
[e2e] create testuser
XiaoJiang521 09b0dfd
[e2e] create testuser
XiaoJiang521 be4b909
[e2e] implent
XiaoJiang521 adadc66
[e2e] implent
XiaoJiang521 1d64fbc
[e2e] implent
XiaoJiang521 cd59074
[e2e] update TESTUSER
XiaoJiang521 6ce5165
[e2e] merge dev
XiaoJiang521 03346e0
[e2e] add schema
XiaoJiang521 737eedd
[e2e] update database
XiaoJiang521 96fa738
[e2e] update get table sql
XiaoJiang521 18cfacf
[e2e] update get table sql
XiaoJiang521 e603c3c
[e2e] remove default schema
XiaoJiang521 e15e07f
[e2e] update sql
XiaoJiang521 1b45439
[e2e] merge dev
XiaoJiang521 ea1aaf7
Merge branch 'dev' into dev_dm_udpdate_gettablename
XiaoJiang521 1d8aa87
[e2e] import package
XiaoJiang521 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
43 changes: 43 additions & 0 deletions
43
...apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCreateTableSqlBuilder.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,43 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.jdbc.catalog; | ||
|
||
import org.apache.seatunnel.api.table.catalog.ConstraintKey; | ||
import org.apache.seatunnel.api.table.catalog.PrimaryKey; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
// todo Abstract the concatenation common content of jdbc auto-build statements | ||
public abstract class AbstractJdbcCreateTableSqlBuilder { | ||
|
||
protected boolean primaryCompareToConstrainKey( | ||
PrimaryKey primaryKey, ConstraintKey constraintKey) { | ||
List<String> columnNames = primaryKey.getColumnNames(); | ||
List<ConstraintKey.ConstraintKeyColumn> constraintKeyColumnNames = | ||
constraintKey.getColumnNames(); | ||
return columnNames.stream() | ||
.map(Object::toString) | ||
.collect(Collectors.toList()) | ||
.containsAll( | ||
constraintKeyColumnNames.stream() | ||
.map(ConstraintKey.ConstraintKeyColumn::getColumnName) | ||
.collect(Collectors.toList())); | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to raise a pr for modification about
AbstractJdbcCreateTableSqlBuilder
and related classes in existing code firstly, and make the improvement on dm catalog in another pr.