Summary
When trying to update the owner of a virtual dataset using the Dremio API via the PUT method, users might encounter an issue where the API call returns a 200 response, indicating success, but the ownership remains unchanged in the Dremio UI. This article addresses the issue and offers a recommended solution.
Main Content
While working with the Dremio API to update the ownership of a dataset object, you might find that using the Catalog API does not successfully change the object's owner, despite receiving a 200 HTTP status code. This is a known limitation as the Catalog API does not support ownership changes.
Instructions to Resolve the Issue
- Check if your current approach includes making a PUT request to the Dremio API endpoint:
/api/v3/catalog/{object_id}. If you're updating the owner field in the dataset's object payload and not seeing any changes reflected in the UI, confirm your payload is correctly formatted, and the desired owner details are specified as:
{ "owner": { "ownerId": "new_owner_id" } ... }Ensure that the REST API call returns a 200 status code but does not update the ownership visible in the Dremio UI.
- The effective solution to update an object's owner is by using the SQL endpoint within the API to run a GRANT command. Follow these steps:
- Open access to the SQL endpoint via your preferred method (e.g., Dremio UI or using a SQL query tool).
- Run the GRANT command, replacing "
new_owner" and "dataset_path" with the respective owner and dataset details:GRANT OWNERSHIP ON TO ; - Confirm that ownership is updated as desired in the UI.
Troubleshooting Tips
- If you still receive a 400 Bad Request error when using tools like Postman, double-check your JSON format for any inconsistencies or errors.
- For confirmed JSON format issues, verify with properly structured JSON that complies with the expected API structure.