hailin0 commented on code in PR #8380:
URL: https://github.com/apache/seatunnel/pull/8380#discussion_r1952088370


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/schema/handler/AlterTableSchemaEventHandler.java:
##########
@@ -132,16 +134,25 @@ private TableSchema applyDropColumn(
     private TableSchema applyModifyColumn(
             TableSchema schema, AlterTableModifyColumnEvent modifyColumnEvent) 
{
         List<String> fieldNames = Arrays.asList(schema.getFieldNames());
-        if (!fieldNames.contains(modifyColumnEvent.getColumn().getName())) {
+        Column modifyColumn = modifyColumnEvent.getColumn();
+        if (!fieldNames.contains(modifyColumn.getName())) {
             return schema;
         }
-
-        String modifyColumnName = modifyColumnEvent.getColumn().getName();
+        String modifyColumnName = modifyColumn.getName();
         int modifyColumnIndex = fieldNames.indexOf(modifyColumnName);
+        Column oldColumn = schema.getColumns().get(modifyColumnIndex);
+        String oldColumnSourceType = oldColumn.getSourceType();
+        String modifyColumnSourceType = modifyColumn.getSourceType();
+        if (StringUtils.isNoneEmpty(oldColumnSourceType)
+                && StringUtils.isNoneEmpty(modifyColumnSourceType)
+                && !oldColumnSourceType.split("\\(")[0].equals(
+                        modifyColumnSourceType.split("\\)")[0])) {

Review Comment:
   ```suggestion
                           modifyColumnSourceType.split("\\(")[0])) {
   ```



-- 
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: commits-unsubscr...@seatunnel.apache.org

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

Reply via email to