xxubai opened a new issue, #4135:
URL: https://github.com/apache/amoro/issues/4135
## What happened?
In the Amoro web UI, the optimizing table duration column becomes blank when
the backend returns a duration between `1ms` and `999ms`.
This happens because `formatMS2Time()` in `amoro-web/src/utils/index.ts`
only appends non-zero day/hour/minute/second units. For values smaller than
`1000ms`, all displayed units are `0`, so the formatted result becomes an empty
string.
Expected behavior:
- Durations between `1ms` and `999ms` should be rendered as `<1s`
- `1000ms` should still be rendered as `1s`
- Existing formatting for longer durations should remain unchanged
This issue affects the optimizing table page and any other frontend view
that reuses the same formatter.
## Affects Versions
master
## What table formats are you seeing the problem on?
- Iceberg
## What engines are you seeing the problem on?
- AMS
- Optimizer
## How to reproduce
1. Start the frontend in mock mode:
```bash
cd amoro-web
npm run dev:mock
```
2. Open the optimizing table page in the web UI.
3. Prepare or mock one or more optimizing table records whose `duration`
value is between `1` and `999`.
4. Observe the duration column.
Current result:
- The corresponding duration cell is blank.
Expected result:
- The same cell should display `<1s`.
## Relevant log output
No backend log is required. This is a frontend formatting issue.
## Anything else
Suggested implementation scope:
- Update `formatMS2Time()` in `amoro-web/src/utils/index.ts`
- Add handling for `0 < ms < 1000`
- Optionally add or update mock data in `amoro-web/mock/modules/optimize.js`
so the behavior is easy to verify manually
Suggested acceptance criteria:
- `500ms -> <1s`
- `999ms -> <1s`
- `1000ms -> 1s`
- Existing values such as `3000ms -> 3s` still work
This is a good first issue because:
- The bug is well scoped
- The affected code path is easy to locate
- The expected behavior is straightforward to verify manually
Screenshot will be added manually after issue creation.
--
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]