roryqi opened a new issue, #12887:
URL: https://github.com/apache/gravitino/issues/12887

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   A statistic name longer than the storage limit is passed to the persistence 
layer and returns HTTP 500 instead of being rejected as invalid input.
   
   The error response also echoes the complete offending name, potentially 
producing an excessively large response.
   
   The API should return HTTP 400, identify the maximum supported length, and 
avoid echoing the complete name.
   
   ### Error message and/or stacktrace
   
   ```text
   HTTP 500
   
   {
     "code": 1002,
     "type": "RuntimeException",
     "message": "Failed to operate statistic(s) [custom-xxxx...]"
   }
   ```
   
   ### How to reproduce
   
   1. Create a table.
   2. Send the following request using a statistic name consisting of `custom-` 
followed by 5,000 characters:
   
      ```text
      PUT 
/api/metalakes/{metalake}/objects/table/{catalog}.{schema}.{table}/statistics
   
      {
        "updates": {
          "custom-xxxx...": 1
        }
      }
      ```
   
   3. Observe that the request returns HTTP 500.
   
   Expected behavior:
   
   - Names up to the supported limit are accepted.
   - Longer names return HTTP 400 with a clear length validation message.
   - The response does not echo the complete offending name.
   
   ### Additional context
   
   The relational schemas define `statistic_name` as `VARCHAR(128)` for both 
table and partition statistics, but the REST write paths do not currently 
validate this limit.


-- 
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]

Reply via email to