NihalJain commented on issue #14068:
URL: https://github.com/apache/pinot/issues/14068#issuecomment-2464606418

   ### Proposal to Contribute a Fix for Database Support in Pinot 1.2.0 UI
   
   I came across this issue where in Pinot 1.2.0 the UI does not support 
creating or querying tables apart from the 'default' database. I propose to fix 
this issue by enhancing the REST API and updating the UI accordingly. (I am a 
backend developer with little UI experience, but the changes seem manageable.)
   
   #### Problem Statement
   - Pinot 1.2.0 supports database constructs, but the UI does not allow 
creating tables within a database or querying tables within a database.
   - The REST API currently returns only resources attached to the default 
database unless explicitly specified.
   
   #### Proposed Solution
   1. **Enhance REST API to support fetching resources for all databases for 
all relevant APIs**:
       - Modify the REST API to support fetching all tables/schemas/etc. 
irrespective of the database name.
       - Modify the existing endpoint to accept a wildcard (`*`) for the 
database header to return resources from all databases.
   
       Example:
       ```sh
       curl -X GET \
         http://localhost:9000/tables \
         -H 'Accept: application/json' \
         -H 'database: *'
       ```
   
   2. **Update the Pinot controller UI**:
       - Allow creating tables within any database by introducing a new, 
optional, input field 'Database'.
       - Allow creating schemas within any database by introducing a new, 
optional, input field 'Database'.
       - Modify the UI to fetch tables/schemas/etc. for all databases by 
setting the database to `*` in the UI context.
   
   3. **Support for db.table Queries**:
       - Implement support for queries in the format `db.table` in the UI.
       - Ensure that the UI sets the appropriate database context before 
executing queries.
   
   4. **Additional Tasks**:
       - Add more tasks as needed, based on deeper insights into the codebase.
   
   #### PoC:
   I just tried doing a PoC of this by changing the behavior of the table API 
to return all tables when no database is specified. See results:
   Create 2 tables with same name in different DBs, here's the output.
   
   - ![Screenshot 2024-11-08 at 5 37 29 
PM](https://github.com/user-attachments/assets/16ad128f-60c3-44cb-8aec-4da3317dd9f0)
   - ![Screenshot 2024-11-08 at 5 36 36 
PM](https://github.com/user-attachments/assets/592a0fb4-294a-44f8-9830-eec4b0327bc2)
   - ![Screenshot 2024-11-08 at 5 36 51 
PM](https://github.com/user-attachments/assets/065234cd-844e-41ca-842e-c87d97fbf76b)
   
   #### Conclusion
   By implementing these changes, we can enhance the functionality of the Pinot 
UI and REST API to support database constructs more effectively. This will 
simplify the process for users working with multiple databases within the same 
cluster. I am eager to contribute to this project and look forward to your 
feedback on this proposal.
   
   
   Thank you for considering my proposal.
   
   Best regards,  
   Nihal Jain


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to