mchades commented on code in PR #14318:
URL: https://github.com/apache/gravitino/pull/14318#discussion_r4408367453
##########
common/src/main/java/org/apache/gravitino/dto/requests/TableCreateRequest.java:
##########
@@ -123,6 +124,9 @@ public void validate() throws IllegalArgumentException {
Preconditions.checkArgument(
StringUtils.isNotBlank(name), "\"name\" field is required and cannot
be empty");
+ // DTO conversion can normalize null literals and discard their declared
types.
Review Comment:
`fromFunctionArg` is also used by `POConverters.fromColumnPO` when reading
stored defaults, so adding write validation there would break legacy reads.
Table and partition requests already validate before conversion, and direct
core calls reject typed null literals that retain `UnparsedType`. I kept the
converter read-compatible and added a regression test for loading a legacy
typed null default.
##########
common/src/main/java/org/apache/gravitino/dto/requests/TableUpdateRequest.java:
##########
@@ -404,6 +405,8 @@ public void validate() throws IllegalArgumentException {
"\"fieldName\" field is required and cannot be empty");
Preconditions.checkArgument(
dataType != null, "\"type\" field is required and cannot be empty");
+ WritableDataTypeValidator.validate(dataType, "type");
Review Comment:
Request validation now includes `updates[i]` for add-column, type changes
and default changes, with tests for nonzero indices and nested type/literal
paths.
--
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]