Copilot commented on code in PR #9559:
URL: https://github.com/apache/seatunnel/pull/9559#discussion_r2197733838


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java:
##########
@@ -319,13 +320,48 @@ static CatalogTable mergeCatalogTable(CatalogTable 
tableOfPath, CatalogTable tab
                         tableOfPath.getTableId().getDatabaseName(),
                         tableOfPath.getTableId().getSchemaName(),
                         tableOfPath.getTableId().getTableName());
+        List<Column> columnsWithComment =

Review Comment:
   [nitpick] Consider extracting the inline lambda transformation into a 
private helper method (e.g., `preserveColumnComments`) to improve readability 
and facilitate unit testing of the merge logic.



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java:
##########
@@ -319,13 +320,48 @@ static CatalogTable mergeCatalogTable(CatalogTable 
tableOfPath, CatalogTable tab
                         tableOfPath.getTableId().getDatabaseName(),
                         tableOfPath.getTableId().getSchemaName(),
                         tableOfPath.getTableId().getTableName());
+        List<Column> columnsWithComment =
+                tableSchemaOfQuery.getColumns().stream()
+                        .map(
+                                column -> {
+                                    return 
columnsOfPath.containsKey(column.getName())
+                                                    && columnsOfPath
+                                                            
.get(column.getName())
+                                                            .getDataType()
+                                                            .getSqlType()
+                                                            .equals(
+                                                                    
columnsOfQuery
+                                                                            
.get(column.getName())
+                                                                            
.getDataType()

Review Comment:
   [nitpick] The comparison looks up `columnsOfQuery.get(column.getName())`, 
but `column` is already from that source. You can simplify by calling 
`column.getDataType().getSqlType()` directly to avoid the redundant map lookup.
   ```suggestion
                                                                       
column.getDataType()
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to