Google's AI-powered collaborator, Gemini, is now available in preview for Dataform users to generate SQLX code. SQLX is an extension of SQL used in Dataform for managing and transforming data through scripts that combine SQL with additional configurations like js. Gemini's automation of script creation aims to reduce errors and enhance code quality.
Gemini, which has already been successful in BigQuery Studio, can generate SQL and Dataform core code inside .sqlx files in Dataform. It doesn't use your prompts or its responses as data for training its models and currently only supports English language prompts.
This update is particularly beneficial for data analysts, data scientists, and data developers who work with SQL workflows in Dataform and have knowledge of Google SQL syntax and how to create Dataform SQL workflow actions.
To use Gemini, users need to:
- Go to the project selector page in the Google Cloud console.
- Select or create a Google Cloud project.
- Activate Gemini in BigQuery.
- Provide Gemini with a natural language statement to generate a SQL or Dataform core query based on SQL workflow actions defined in your repository.
To improve Gemini's suggestions, users can:
- Provide the SQL action name enclosed in backticks such as
action_name
. - If the column names or their semantic relationships are unclear or complex, provide context in the prompt to guide Gemini towards the desired answer. This technique is known as prompt engineering.