ChoiByungHo created ZEPPELIN-6247:
-------------------------------------
Summary: Fix flag parsing bug in FileInterpreter
Key: ZEPPELIN-6247
URL: https://issues.apache.org/jira/browse/ZEPPELIN-6247
Project: Zeppelin
Issue Type: Bug
Reporter: ChoiByungHo
Assignee: ChoiByungHo
Description:
This issue fixes a bug in the FileInterpreter class where the dash character
(-) was incorrectly included as a flag when parsing command arguments.
Problem:
The current implementation of parseArg() method in FileInterpreter.java
incorrectly includes the dash character as a flag. When parsing command
arguments like "-l", the method adds both '-' and
'l' to the flags HashSet instead of just 'l'.
Current code (line 73):
for (int i = 0; i < arg.length(); i++) {
This causes the dash character to be incorrectly stored as a flag.
Solution:
Start the loop from index 1 to skip the dash character:
for (int i = 1; i < arg.length(); i++) {
Impact Analysis:
- Current behavior is not affected because the existing code
(HDFSFileInterpreter) only checks for specific flag characters like 'l' and 'h'
- However, this is a correctness issue that could cause problems in future
implementations
- The fix ensures that only actual flag characters are stored in the flags set
--
This message was sent by Atlassian Jira
(v8.20.10#820010)