Hue SQL AI Assistant FAQ
A collection of frequently asked questions about Hue SQL AI Assistant.
General Questions
- What is the SQL AI Assistant in Hue?
- The SQL AI Assistant in Hue is an AI-powered tool integrated into the SQL editor that helps users generate, edit, optimize, fix, and summarise SQL queries using natural language. It leverages large language models (LLMS) to assist data analysts in making SQL development faster, easier, and less error-prone.
- Which SQL dialects does the SQL AI Assistant support?
- Multiple SQL dialects are supported, including Hive, Impala, and Trino.
Using SQL AI Assistant
- How do I launch the SQL AI Assistant?
- Click the
Assistant to expand the SQL AI toolbar, which provides buttons for generating, editing, explaining, optimising, and fixing SQL statements.
- What happens when I click 'Generate' in the SQL AI Assistant?
- Clicking "Generate" allows you to enter a natural language query, which the assistant converts into an SQL query. The generated SQL is presented along with assumptions made by the LLM.
- Can I create a query that joins multiple databases when using the Hue SQL AI Assistant?
- Yes, the Hue SQL AI Assistant supports multi-database queries. You can select multiple databases in the AI Assistant Settings pop-up, allows you to create queries that join tables across different databases.
- How does the 'Edit' function work?
- The "Edit" button allows users to modify an active SQL statement. If an NQL comment precedes the statement, it can be reused by pressing Tab. Users can also enter new instructions for modifications.
- What do 'Optimize' and 'Fix' do?
-
-
"Optimize" improves SQL query structure and performance while maintaining the original results.
-
"Fix" automatically corrects syntactic errors and misspellings in the SQL query.
-
- How does the 'Explain' function work?
- The "Explain" button provides a natural language summary and explanation of the selected SQL query, which can be inserted as a comment in the editor.
AI Models and Security
- Which AI models does the SQL AI Assistant support?
- The Hue SQL AI Assistant supports Cloudera AI Workbench and Cloudera AI Inference service, along with several third-party services. Using the Cloudera integrations enhances the Hue SQL AI Assistant by enabling the use of private models hosted within Cloudera-managed infrastructure. This ensures enhanced security and privacy while leveraging GenAI for the Hue SQL-related tasks. For more information, see Supported services.
- How does the SQL AI Assistant handle data privacy?
- The SQL AI Assistant shares only the data that the logged-in user is authorised to access. It uses a Retrieval Augmented Generation (RAG)-based architecture to limit the number of tables sent per request. However, there is currently no way to explicitly exclude certain tables from being shared.
Configuration and Setup
- What AI services are supported for integration?
- Supported services include:
- Is it necessary to train the Hue SQL AI Assistant on the database schema before using it?
- Training is not necessary for the Hue SQL AI Assistant. Once connected, the assistant
can begin querying immediately. However, in cases where table names are similar or
column names are repeated across multiple tables, it is recommended to ensure that the
database metadata is well-maintained. Specifically:
- Table and column comments should be clear and descriptive they are used by the assistant for context and disambiguation.
- Consider using distinct table and column naming conventions to reduce confusion.
- Ensure that schema and table relationships are properly defined, as this helps the assistant understand context.