yuqi1129 opened a new issue, #14580:
URL: https://github.com/apache/gravitino/issues/14580
### Version
main branch
### Describe what's wrong
REST request validation leaves several null-input gaps:
- PATCH catalog or metalake with `{}` or `{"inUse":null}` is interpreted as
`inUse=false` and silently disables the object.
- Null entries in table partition/index arrays or table/schema/view update
lists can raise NullPointerException instead of a field validation error.
- Create requests with `properties: {"k":null}` can fail in event info
construction (`ImmutableMap.copyOf`) instead of returning HTTP 400.
- Explicit JSON `defaultValue:null` can leave a column default unset as Java
null, unlike the Java builder, which normalizes it to `DEFAULT_VALUE_NOT_SET`.
### Error message and/or stacktrace
Invalid requests can return HTTP 500 with a NullPointerException; an
omitted/null `inUse` instead returns success and changes the object's state.
### How to reproduce
1. PATCH an enabled catalog or metalake with `{}` or `{"inUse":null}` and
inspect its in-use state.
2. Create a table with `partitioning:[null]` or `indexes:[null]`, or alter a
table/schema/view with `updates:[null]`.
3. Create a metalake/catalog/schema/fileset/topic/table/view with
`properties:{"k":null}`.
4. Deserialize a column with `defaultValue:null` and inspect its default
expression.
### Additional context
Reject invalid fields before dispatch, preserve explicit true/false and
nullable optional containers, and keep JSON null defaults distinct from the
explicit SQL NULL literal. No storage-format or connector changes are needed.
--
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]