Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix]Fix the problem of "," being divided in [] #5401

Merged
merged 5 commits into from
Sep 1, 2023

Conversation

liugddx
Copy link
Member

@liugddx liugddx commented Aug 30, 2023

Purpose of this pull request

Check list

@liugddx liugddx linked an issue Aug 30, 2023 that may be closed by this pull request
3 tasks
Pattern pattern = Pattern.compile("\\[.*?]|,");

@Override
public List<String> split(String value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add doc and UT for this method, and if the params contains ";" what will happen?
e.g. if the args looks like -i "map = ["par1=20230829;", "par2=20230829;"]"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add doc and UT for this method, and if the params contains ";" what will happen? e.g. if the args looks like -i "map = ["par1=20230829;", "par2=20230829;"]"

Yes, this code has a bug, I modified the implementation.PTAL

liugddx and others added 2 commits August 30, 2023 21:29
…/seatunnel/core/starter/command/ParameterSplitter.java

Co-authored-by: Wenjun Ruan <wenjun@apache.org>
ruanwenjun
ruanwenjun previously approved these changes Aug 31, 2023
Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically LGTM.

I am not sure if there still exist some cases will have another problem, e.g "-i map=["par1=[2023, 2024, 2025]", "par2=[2026, 2027]"]".

It might be better to use some inner method provided by JCommander to handle the array.

@liugddx
Copy link
Member Author

liugddx commented Aug 31, 2023

Since the quotes [] cannot be parsed, special processing is required.
93c6163773f0e38a7857eb7cf55fb5b

@liugddx
Copy link
Member Author

liugddx commented Aug 31, 2023

@ruanwenjun @EricJoy2048 PTAL

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@liugddx liugddx merged commit d8c92a1 into apache:dev Sep 1, 2023
53 checks passed
Zhouwen-CN pushed a commit to Zhouwen-CN/seatunnel that referenced this pull request Sep 11, 2023
* Fix the problem of "," being divided in []

* Update seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/command/ParameterSplitter.java

Co-authored-by: Wenjun Ruan <wenjun@apache.org>

* fix error

* fix bug

* fix bug

---------

Co-authored-by: Wenjun Ruan <wenjun@apache.org>
Zhouwen-CN pushed a commit to Zhouwen-CN/seatunnel that referenced this pull request Sep 11, 2023
* Fix the problem of "," being divided in []

* Update seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/command/ParameterSplitter.java

Co-authored-by: Wenjun Ruan <wenjun@apache.org>

* fix error

* fix bug

* fix bug

---------

Co-authored-by: Wenjun Ruan <wenjun@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Seatunnel] Seatunnel -i command bug
3 participants