yihua opened a new pull request, #9445:
URL: https://github.com/apache/hudi/pull/9445
### Change Logs
This PR fixes the log file CLI commands when the log file contains command
blocks like rollback commands.
The tests are adjusted to consider such a scenario. Without the fix, the
new tests fail.
Before the fix, when there are rollback command blocks in the log files, the
log file command throws NPE:
```
hudi:hoodie_table->show logfile metadata --logFilePathPattern
file:<base_path>/.1414abd2-346b-4c84-b380-c6ea6ec0863a-0_20230813220941456.log*
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at
org.apache.hudi.cli.commands.HoodieLogFileCommand.showLogFileCommits(HoodieLogFileCommand.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.springframework.shell.command.invocation.InvocableShellMethod.doInvoke(InvocableShellMethod.java:306)
at
org.springframework.shell.command.invocation.InvocableShellMethod.invoke(InvocableShellMethod.java:232)
at
org.springframework.shell.command.CommandExecution$DefaultCommandExecution.evaluate(CommandExecution.java:158)
at org.springframework.shell.Shell.evaluate(Shell.java:208)
at org.springframework.shell.Shell.run(Shell.java:140)
at
org.springframework.shell.jline.InteractiveShellRunner.run(InteractiveShellRunner.java:73)
at
org.springframework.shell.DefaultShellApplicationRunner.run(DefaultShellApplicationRunner.java:65)
at
org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762)
at
org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:752)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
at org.apache.hudi.cli.Main.main(Main.java:34)
```
### Impact
Bug fix on log file CLI.
### Risk level
none
### Documentation Update
N/A
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]