[
https://issues.apache.org/jira/browse/FLINK-14604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wei Zhong updated FLINK-14604:
------------------------------
Comment: was deleted
(was: [~chesnay] Sorry for the late reply. During this time I conducted a
investigation and found a solution without upgrading the commons-cli version.
This is the discussion thread of the new solution:
[http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-Improve-the-Pyflink-command-line-options-Adjustment-to-FLIP-78-td35440.html])
> Bump commons-cli to 1.4
> -----------------------
>
> Key: FLINK-14604
> URL: https://issues.apache.org/jira/browse/FLINK-14604
> Project: Flink
> Issue Type: Task
> Components: Build System, Command Line Client
> Reporter: Wei Zhong
> Priority: Major
>
> Currently flink is using commons-cli 1.3.1. There is a
> [bug|https://issues.apache.org/jira/projects/CLI/issues/CLI-265] in it which
> prevent us from using options that accept variable arguments in command line.
> To be precise, it prevents us from accepting a short-name option after a
> varargs option because there is a problem in the implementation of
> DefaultParser#isShortOption() method in commons-cli 1.3.1:
> {code:java}
> /**
> * Tells if the token looks like a short option.
> *
> * @param token
> */
> private boolean isShortOption(String token)
> {
> // short options (-S, -SV, -S=V, -SV1=V2, -S1S2)
> // PROBLEM: It assumes that short option only has single character,
> // but in fact we have many multi-characters short options.
> return token.startsWith("-") && token.length() >= 2 &&
> options.hasShortOption(token.substring(1, 2));
> }
> {code}
> If we bump the version to 1.4, we can solve this problem.
> I request this change because there are 2 varargs options which hit this bug
> in the design of command line options of [Python UDF Dependency
> Management|https://cwiki.apache.org/confluence/display/FLINK/FLIP-78%3A+Flink+Python+UDF+Environment+and+Dependency+Management].
> It will be great helpful if we can bump the commons-cli version to 1.4 :).
> The commons-cli 1.4 is also a stable version which released at Mar, 2017. And
> today its usage statistic is greater than 1.3.1 on [maven central
> repository|https://mvnrepository.com/artifact/commons-cli/commons-cli].
> I have pushed the change to my own travis to check if it breaks something.
> This is the [link|https://travis-ci.org/WeiZhong94/flink/builds/607438208]
> and it seems that everything is fine.
> This is the [link|https://travis-ci.org/WeiZhong94/flink/builds/607481477] of
> travis build which contains e2e tests, it seems fine except the timeout tasks.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)