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


##########
seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeUtil.java:
##########
@@ -68,15 +68,19 @@ public static TableTunnel.DownloadSession 
getDownloadSession(ReadonlyConfig read
                 PartitionSpec partitionSpec =
                         new 
PartitionSpec(readonlyConfig.get(MaxcomputeBaseOptions.PARTITION_SPEC));
                 session =
-                        tunnel.createDownloadSession(
-                                
readonlyConfig.get(MaxcomputeBaseOptions.PROJECT),
-                                
readonlyConfig.get(MaxcomputeBaseOptions.TABLE_NAME),
-                                partitionSpec);
+                        tunnel.buildDownloadSession(

Review Comment:
   [nitpick] The code for creating the builder (project, table) and setting 
schema is duplicated in both branches. Consider extracting a helper method or 
variable for `tunnel.buildDownloadSession(...).setSchemaName(...)` to reduce 
duplication.



##########
seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeUtil.java:
##########
@@ -68,15 +68,19 @@ public static TableTunnel.DownloadSession 
getDownloadSession(ReadonlyConfig read
                 PartitionSpec partitionSpec =
                         new 
PartitionSpec(readonlyConfig.get(MaxcomputeBaseOptions.PARTITION_SPEC));
                 session =
-                        tunnel.createDownloadSession(
-                                
readonlyConfig.get(MaxcomputeBaseOptions.PROJECT),
-                                
readonlyConfig.get(MaxcomputeBaseOptions.TABLE_NAME),
-                                partitionSpec);
+                        tunnel.buildDownloadSession(
+                                        
readonlyConfig.get(MaxcomputeBaseOptions.PROJECT),
+                                        
readonlyConfig.get(MaxcomputeBaseOptions.TABLE_NAME))
+                                
.setSchemaName(tunnel.getConfig().getOdps().getCurrentSchema())

Review Comment:
   [nitpick] Retrieving the current schema via 
`tunnel.getConfig().getOdps().getCurrentSchema()` is repeated; consider storing 
it in a local variable before the conditional to improve readability and 
performance.
   ```suggestion
                                   .setSchemaName(currentSchema)
   ```



-- 
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