You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:02:14 UTC

[GitHub] [incubator-seatunnel] TyrantLucifer commented on a diff in pull request #2980: [Bug][Connector-V2] Fix the bug of incorrect path in windows environment

TyrantLucifer commented on code in PR #2980:
URL: https://github.com/apache/incubator-seatunnel/pull/2980#discussion_r985634997


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/AbstractWriteStrategy.java:
##########
@@ -237,7 +236,7 @@ public void beginTransaction(Long checkpointId) {
      */
     public List<String> getTransactionIdFromStates(List<FileSinkState> fileStates) {
         String[] pathSegments = new String[]{textFileSinkConfig.getPath(), Constant.SEATUNNEL, jobId};
-        String jobDir = String.join(File.separator, pathSegments) + "/";
+        String jobDir = String.join("/", pathSegments) + "/";

Review Comment:
   Because the `File.separator` that in Windows is `\`, so the path be joined it will be like this:
   
   `/tmp/seatunnel/dist\xxxx.txt`
   
   this path hdfs protocol is not recognized, I have tried to change the path to the windows format like `\tmp\seatunnel\dist\xxx.txt`, but the hdfs protocol still can not recognize. So in order to run the test cases related to the file connector in the windows environment I decided to change it. 
   
   The purpose of this pr is to be able to debug better in the windows environment, there is no impact on the normal function.
   
   If you think it is not necessary, we can close it.



-- 
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-unsubscribe@seatunnel.apache.org

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