chengshiwen opened a new pull request #4166:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4166


   ## *Tips*
   - *Thanks very much for contributing to Apache DolphinScheduler.*
   - *Please review 
https://dolphinscheduler.apache.org/en-us/community/index.html before opening a 
pull request.*
   
   ## What is the purpose of the pull request
   
   *Fix flink args build problem*
   
   The official flink run command is `flink run [OPTIONS] <jar-file> 
<arguments>` (ref: 
[flink-1.9-cli](https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/cli.html)
 and  
[flink-1.11-cli](https://ci.apache.org/projects/flink/flink-docs-release-1.11/ops/cli.html)),
 but there are some errors in the code:
    - the `other args` is after the `main args`, so that it will be part of the 
`main args`
    - the flink queue option is also after the `main args`, so that the option 
doesn't work
    - the flink queue option is `-yqu`, not `--qu`, and it's only for yarn. see 
[flink-1.9-cli](https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/cli.html)
 and  
[flink-1.11-cli](https://ci.apache.org/projects/flink/flink-docs-release-1.11/ops/cli.html)
    - the comment `--files --conf --libjar ...` is for spark, not for flink
   
   ## Brief change log
   
   *Flink args:*
    - *[Improvement][UI] hide version and cluster input when deployMode is 
local*
    - *[Fix][Flink] fix flink args build problem*
      - Adjust the order of the `other args` and optimize the logic
      - Rename the flink queue option `--qu` to `-yqu`
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is already covered by existing tests, such as *(please 
describe tests)*.
   
   (and)
   
   This change added tests and can be verified as follows:
   
   Assume that:
    - main args: `--input file:///home/user/hamlet.txt --output 
file:///home/user/wordcount_out`
   - other args: `-p 4`
   
   **Before fix, the generated flink commands are as follow**:
    - **local**: `flink run -c 
org.apache.flink.examples.java.wordcount.WordCount WordCount.jar --input 
file:///home/user/hamlet.txt --output file:///home/user/wordcount_out -p 4`
    - **cluster**: `flink run -m yarn-cluster -ys 1 -yn 2 -yjm 1G -ytm 2G -d -c 
org.apache.flink.examples.java.wordcount.WordCount WordCount.jar --input 
file:///home/user/hamlet.txt --output file:///home/user/wordcount_out --qu test 
-p 4`
   
   **After fix, the generated flink commands are as follow**:
    - **local**: `flink run -p 4 -c 
org.apache.flink.examples.java.wordcount.WordCount WordCount.jar --input 
file:///home/user/hamlet.txt --output file:///home/user/wordcount_out`
    - **cluster**: `flink run -m yarn-cluster -ys 1 -yn 2 -yjm 1G -ytm 2G -yqu 
test -d -p 4 -c org.apache.flink.examples.java.wordcount.WordCount 
WordCount.jar --input file:///home/user/hamlet.txt --output 
file:///home/user/wordcount_out`
   
   


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

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


Reply via email to