You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2023/07/07 08:58:41 UTC

[GitHub] [incubator-paimon] yuzelin opened a new pull request, #1521: [bug][flink] CDC schema evolution should pass catalog information

yuzelin opened a new pull request, #1521:
URL: https://github.com/apache/incubator-paimon/pull/1521

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   
   <!-- What is the purpose of the change -->
   For example, if user use Hive catalog in CDC, currently the schema change information is only recorded into file system, but 
   cannot be seen in Hive meta store. This PR fix it.
    
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   `TestAlterTableCatalogFactory`
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1521: [bug][flink] CDC schema evolution should pass catalog information

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #1521:
URL: https://github.com/apache/incubator-paimon/pull/1521#discussion_r1255682213


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/cdc/UpdatedDataFieldsProcessFunction.java:
##########
@@ -107,17 +122,22 @@ private List<SchemaChange> extractSchemaChanges(List<DataField> updatedDataField
     private void applySchemaChange(SchemaChange schemaChange) throws Exception {
         if (schemaChange instanceof SchemaChange.AddColumn) {
             try {
-                schemaManager.commitChanges(schemaChange);
-            } catch (Catalog.ColumnAlreadyExistException e) {
-                // This is normal. For example when a table is split into multiple database tables,
-                // all these tables will be added the same column. However schemaManager can't
-                // handle duplicated column adds, so we just catch the exception and log it.
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug(
-                            "Failed to perform SchemaChange.AddColumn {}, "
-                                    + "possibly due to duplicated column name",
-                            schemaChange,
-                            e);
+                catalog.alterTable(identifier, schemaChange, false);
+            } catch (Exception e) {
+                if (e.getCause() instanceof Catalog.ColumnAlreadyExistException) {

Review Comment:
   Consider to modify alterTable interface:
   ```
   void alterTable(Identifier identifier, List<SchemaChange> changes, boolean ignoreIfNotExists)
               throws TableNotExistException, ColumnAlreadyExistException, ColumnNotExistException;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] JingsongLi merged pull request #1521: [bug][flink] CDC schema evolution should pass catalog information

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #1521:
URL: https://github.com/apache/incubator-paimon/pull/1521


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org