-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][CDC][Zeta] Support schema evolution framework(DDL)
- Loading branch information
Showing
54 changed files
with
2,039 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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 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 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
53 changes: 53 additions & 0 deletions
53
...nnel-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableAddColumnEvent.java
This file contains 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,53 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.Column; | ||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableAddColumnEvent extends AlterTableColumnEvent { | ||
private final Column column; | ||
private final boolean first; | ||
private final String afterColumn; | ||
|
||
public AlterTableAddColumnEvent( | ||
TablePath tablePath, Column column, boolean first, String afterColumn) { | ||
super(tablePath); | ||
this.column = column; | ||
this.first = first; | ||
this.afterColumn = afterColumn; | ||
} | ||
|
||
public static AlterTableAddColumnEvent addFirst(TablePath tablePath, Column column) { | ||
return new AlterTableAddColumnEvent(tablePath, column, true, null); | ||
} | ||
|
||
public static AlterTableAddColumnEvent add(TablePath tablePath, Column column) { | ||
return new AlterTableAddColumnEvent(tablePath, column, false, null); | ||
} | ||
|
||
public static AlterTableAddColumnEvent addAfter( | ||
TablePath tablePath, Column column, String afterColumn) { | ||
return new AlterTableAddColumnEvent(tablePath, column, false, afterColumn); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...l-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableChangeColumnEvent.java
This file contains 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,55 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.Column; | ||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableChangeColumnEvent extends AlterTableAddColumnEvent { | ||
private final String oldColumn; | ||
|
||
public AlterTableChangeColumnEvent( | ||
TablePath tablePath, | ||
String oldColumn, | ||
Column column, | ||
boolean first, | ||
String afterColumn) { | ||
super(tablePath, column, first, afterColumn); | ||
this.oldColumn = oldColumn; | ||
} | ||
|
||
public static AlterTableChangeColumnEvent changeFirst( | ||
TablePath tablePath, String oldColumn, Column column) { | ||
return new AlterTableChangeColumnEvent(tablePath, oldColumn, column, true, null); | ||
} | ||
|
||
public static AlterTableChangeColumnEvent change( | ||
TablePath tablePath, String oldColumn, Column column) { | ||
return new AlterTableChangeColumnEvent(tablePath, oldColumn, column, false, null); | ||
} | ||
|
||
public static AlterTableChangeColumnEvent changeAfter( | ||
TablePath tablePath, String oldColumn, Column column, String afterColumn) { | ||
return new AlterTableChangeColumnEvent(tablePath, oldColumn, column, false, afterColumn); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableColumnEvent.java
This file contains 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,12 @@ | ||
package org.apache.seatunnel.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.ToString; | ||
|
||
@ToString(callSuper = true) | ||
public abstract class AlterTableColumnEvent extends AlterTableEvent { | ||
public AlterTableColumnEvent(TablePath tablePath) { | ||
super(tablePath); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableColumnsEvent.java
This file contains 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,46 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableColumnsEvent extends AlterTableEvent { | ||
private final List<AlterTableColumnEvent> events; | ||
|
||
public AlterTableColumnsEvent(TablePath tablePath) { | ||
this(tablePath, new ArrayList<>()); | ||
} | ||
|
||
public AlterTableColumnsEvent(TablePath tablePath, List<AlterTableColumnEvent> events) { | ||
super(tablePath); | ||
this.events = events; | ||
} | ||
|
||
public AlterTableColumnsEvent addEvent(AlterTableColumnEvent event) { | ||
events.add(event); | ||
return this; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...nel-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableDropColumnEvent.java
This file contains 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,34 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableDropColumnEvent extends AlterTableColumnEvent { | ||
private final String column; | ||
|
||
public AlterTableDropColumnEvent(TablePath tablePath, String column) { | ||
super(tablePath); | ||
this.column = column; | ||
} | ||
} |
This file contains 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
46 changes: 46 additions & 0 deletions
46
...l-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableModifyColumnEvent.java
This file contains 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,46 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.Column; | ||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableModifyColumnEvent extends AlterTableAddColumnEvent { | ||
public AlterTableModifyColumnEvent( | ||
TablePath tablePath, Column column, boolean first, String afterColumn) { | ||
super(tablePath, column, first, afterColumn); | ||
} | ||
|
||
public static AlterTableModifyColumnEvent modifyFirst(TablePath tablePath, Column column) { | ||
return new AlterTableModifyColumnEvent(tablePath, column, true, null); | ||
} | ||
|
||
public static AlterTableModifyColumnEvent modify(TablePath tablePath, Column column) { | ||
return new AlterTableModifyColumnEvent(tablePath, column, false, null); | ||
} | ||
|
||
public static AlterTableModifyColumnEvent modifyAfter( | ||
TablePath tablePath, Column column, String afterColumn) { | ||
return new AlterTableModifyColumnEvent(tablePath, column, false, afterColumn); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/event/AlterTableNameEvent.java
This file contains 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,34 @@ | ||
/* | ||
* 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.api.table.event; | ||
|
||
import org.apache.seatunnel.api.table.catalog.TablePath; | ||
|
||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString(callSuper = true) | ||
public class AlterTableNameEvent extends AlterTableColumnEvent { | ||
private final TablePath newTablePath; | ||
|
||
public AlterTableNameEvent(TablePath tablePath, TablePath newTablePath) { | ||
super(tablePath); | ||
this.newTablePath = newTablePath; | ||
} | ||
} |
Oops, something went wrong.