roryqi opened a new issue, #12977:
URL: https://github.com/apache/gravitino/issues/12977
### What would you like to be improved?
Gravitino currently uses `.` as the qualified-name delimiter and does not
support dots within an individual entity name. However, external systems may
already contain such objects. For example:
```bash
# Kafka
kafka-topics.sh --create --topic one.dot \
--partitions 1 --replication-factor 1
# PostgreSQL
CREATE TABLE "sales.2024" (id INT);
```
The current behavior is misleading and varies by connector:
- The Kafka catalog omits dotted topics from the topic listing.
- The JDBC catalog lists a dotted table, but cannot load it.
- Loading either object may return:
```json
{
"code": 1002,
"type": "RuntimeException",
"message": "Authorization failed due to system internal error. Please
contact administrator."
}
```
The underlying exception is:
```text
java.lang.IllegalArgumentException:
If the type is TOPIC, the length of names must be 3
```
`NameIdentifierUtil.toMetadataObject` eventually constructs a dot-separated
full name, and `MetadataObjects.parse` splits it again. An entity name such as
`one.dot` is therefore interpreted as an additional namespace level. The
exception is then caught by `GravitinoInterceptionService` and incorrectly
reported as an authorization failure.
This is not an authorization problem, and an administrator cannot resolve
it. In the Kafka case, silently omitting the object also makes the catalog
appear complete when it is not.
Supporting dots in entity names is already discussed in #9926 and discussion
#7296. This improvement is about providing correct and consistent behavior
while dots remain unsupported.
### How should we improve?
- Detect unsupported dots in an individual entity name at a stable
validation boundary, before authorization metadata conversion fails.
- Return a clear client error, preferably HTTP 400 with error code `1001`,
for example:
```text
The TOPIC name 'one.dot' is unsupported because '.' is reserved as the
qualified-name separator.
```
- Do not convert identifier validation failures into an internal
authorization error. This is related to #10626, which covers another validation
failure currently wrapped by the authorization interceptor.
- Make list and load behavior consistent across connectors. Unsupported
external objects should not be silently omitted without any diagnostic.
- Add regression tests covering at least:
- a Kafka topic containing `.`;
- a quoted JDBC table containing `.`;
- list and load operations;
- the returned HTTP status, error code, and message.
--
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]