Roshan1299 opened a new pull request, #14636: URL: https://github.com/apache/gravitino/pull/14636
### What changes were proposed in this pull request? Items 3 and 6 of #13317: - `ViewNormalizeDispatcher` checks `defaultCatalog` and `defaultSchema` against `EntityFieldLimits.MAX_NAME_LENGTH` on `createView`, and on `alterView` for a `ReplaceView` change, before the underlying catalog is called. This follows the comment check `TopicNormalizeDispatcher` does on create and alter. - `MetalakeHookDispatcher.createMetalake` checks the current user name against the same limit before the metalake is created, when access control is enabled (the only case where the creator is added as a user). ### Why are the changes needed? `view_version_info.default_catalog` / `default_schema` and `user_meta.user_name` are `VARCHAR(128)` in the H2, MySQL and PostgreSQL schemas. - A longer view default was accepted by the external catalog, and the entity store write that then failed was only logged, so the view existed without its Gravitino entity. - A creator name longer than 128 characters failed in `addUser` after the metalake was already committed, leaving the metalake without its creator user and owner. Both now fail with an `IllegalArgumentException` before anything is created, with the message format from #13312 (for example "The default catalog of the view must not exceed 128 characters"). Part of #13317. Item 2 needs no change, per the discussion on the issue. ### Does this PR introduce _any_ user-facing change? Creating or replacing a view with a default catalog or schema longer than 128 characters, and creating a metalake as a user whose name is longer than 128 characters (with access control enabled), are now rejected up front instead of partly succeeding. ### How was this patch tested? - `TestViewNormalizeDispatcher.testDefaultsLength`: a 129-character default catalog or schema is rejected on create (and the view is not created) and on `ReplaceView`; 128 characters are accepted and the stored view is unchanged after the rejected alter. - `TestMetalakeHookDispatcher.testCreateMetalakeRejectsTooLongCreatorName`: a 129-character creator name is rejected without calling `createMetalake` or `addUser`; a 128-character name creates the metalake and adds the user. - `./gradlew :core:test -PskipITs`: 3341 tests, 0 failures (2 skipped). `:core:spotlessCheck` passes. - With the two main-code changes reverted, both new tests fail. -- 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]
