Skip to content

[ZEPPELIN-6395] Fix NumberFormatException for numeric interpreter properties in New UI#5147

Closed
kevinjmh wants to merge 1 commit into
apache:masterfrom
kevinjmh:patch-2
Closed

[ZEPPELIN-6395] Fix NumberFormatException for numeric interpreter properties in New UI#5147
kevinjmh wants to merge 1 commit into
apache:masterfrom
kevinjmh:patch-2

Conversation

@kevinjmh

@kevinjmh kevinjmh commented Feb 2, 2026

Copy link
Copy Markdown
Member

What is this PR for?

Problem:

The New UI (Angular) saves numeric interpreter properties as JavaScript number types, which get deserialized to Java Double by Gson. When these properties are converted to strings (e.g., 60000.0), parsing them as Long or Integer fails with NumberFormatException.

Solution:

Convert all property values to strings in the New UI before sending to the backend, matching the behavior of the Old UI which uses strings for all property values.

What type of PR is it?

Bug Fix

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-6395

How should this be tested?

  • Strongly recommended: add automated unit tests for any new or changed behavior
  • Outline any manual steps to test the PR here.

Screenshots (if appropriate)

Questions:

  • Does the license files need to update?
  • Is there breaking changes for older versions?
  • Does this needs documentation?

@kevinjmh

Copy link
Copy Markdown
Member Author

See #5265

@kevinjmh kevinjmh closed this Jun 16, 2026
tbonelee added a commit that referenced this pull request Jun 16, 2026
### What is this PR for?

Numeric interpreter properties edited in the Angular UI are sent as JSON numbers, which Gson deserializes as `Double` (`60000` → `"60000.0"`), breaking `Long`/`Integer` parsing in interpreters such as JDBC (ZEPPELIN-6395). The server-side workaround from ZEPPELIN-6131 only covers the update path, not create.

This PR fixes it on the client by converting `InterpreterItemComponent` from `UntypedFormBuilder` to typed reactive forms:

- Non-checkbox values are sent as strings (like the classic UI); checkbox values stay real booleans, and `"true"`/`"false"` strings from corrupted data are normalized back on save.
- New request DTOs mirror the fields `InterpreterOption.java` actually reads; the UI-only `session`/`process` fields (dead since ZEPPELIN-1210) are no longer sent.
- Fixes wrong `Properties.value`/`type` interface types; response option fields that Gson omits when null are now optional.

Alternative to #5147, which stringifies checkbox booleans too — persisting `"false"` makes an unchecked checkbox render as checked on reload. Credit to <at>kevinjmh for the original diagnosis.

### What type of PR is it?
Improvement

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6427 (fixes ZEPPELIN-6395)

### How should this be tested?

No unit test infra exists in `zeppelin-web-angular` (Playwright e2e only), so verified by `ng build` (strict, 0 errors), lint/prettier, and manually: numeric property saves as `"60000"` in `interpreter.json` (create and update), JDBC paragraph runs without `NumberFormatException`, unchecked checkbox stays unchecked after reload, and a regression pass over create/edit/cancel, property and dependency CRUD, and interpreter binding mode options.

### Screenshots (if appropriate)
N/A

### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No


Closes #5265 from tbonelee/ZEPPELIN-6427-typed-interpreter-forms.

Signed-off-by: ChanHo Lee <chanholee@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants