Gemini에 자연어 문(또는 프롬프트)을 제공하여 저장소에 정의된 SQL 워크플로 작업을 기반으로 SQL 또는 Dataform Core 쿼리를 생성할 수 있습니다.
예를 들어 Gemini를 사용하여 .sqlx 테이블 정의 파일에서 SQL SELECT 문을 생성할 수 있습니다.
사용할 SQL 작업을 알고 있는 경우 프롬프트에서 작업 이름을 백틱(`)으로 지정할 수 있습니다.
생성을 클릭합니다.
Gemini는 저장소에 정의된 SQL 작업을 검토하여 프롬프트와 관련될 수 있는 작업을 찾고 쿼리를 제안합니다.
(선택사항) 의견을 제공하려면 thumb_up좋아요, thumb_down싫어요, 또는 chat_info추가 의견 보내기를 클릭합니다.
추천을 수락하려면 삽입을 클릭합니다.
쿼리 생성 도움말
다음은 Gemini in Dataform에서 제공하는 추천을 개선하는 팁입니다.
SQL 작업 이름을 백틱(`)으로 묶어서 제공하세요(예: `action_name`).
열 이름 또는 시맨틱스 관계가 명확하지 않거나 복잡한 경우 프롬프트에 컨텍스트를 제공하여 Gemini가 개발자가 원하는 답변을 제공하도록 안내할 수 있습니다. 이러한 기법을 프롬프트 엔지니어링이라고 합니다. 예를 들어 생성된 쿼리가 열 이름을 참조하도록 하려면 열 이름과 원하는 답변과의 관련성을 설명합니다. 평생 가치 또는 총이익과 같이 복잡한 용어를 참조하는 답변을 유도하려면 개념 및 데이터와의 관련성을 설명하여 SQL 생성 결과를 향상시킵니다.
Gemini 및 Dataform 데이터
Dataform의 Gemini는 개발자에게 액세스 권한이 있는 테이블의 메타데이터에 액세스할 수 있습니다. 여기에는 테이블 이름, 열 이름, 데이터 유형, 열 설명이 포함될 수 있습니다. Dataform의 Gemini는 테이블, 뷰 또는 모델의 데이터에 액세스할 수 없습니다. Gemini에서 데이터를 사용하는 방법에 대한 자세한 내용은 Google Cloud용 Gemini가 데이터를 사용하는 방법을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eGemini, an AI-powered tool in Google Cloud, can generate SQL and Dataform core code within \u003ccode\u003e.sqlx\u003c/code\u003e files in Dataform.\u003c/p\u003e\n"],["\u003cp\u003eGemini in Dataform uses natural language prompts to create SQL or Dataform core queries based on SQL workflow actions in your repository.\u003c/p\u003e\n"],["\u003cp\u003eTo use Gemini in Dataform, you must select or create a Google Cloud project and activate the feature in BigQuery.\u003c/p\u003e\n"],["\u003cp\u003eWhile using Gemini for generating code, you can provide feedback, and are recommended to validate its output due to its early-stage development.\u003c/p\u003e\n"],["\u003cp\u003eGemini in Dataform can access table metadata but not the actual data within tables, views, or models.\u003c/p\u003e\n"]]],[],null,["# Create actions with Gemini assistance\n\n| **Preview\n| --- Gemini in Dataform**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can use [Gemini](/gemini/docs/overview), an AI-powered\ncollaborator in Google Cloud, to generate SQL and Dataform core\ncode inside `.sqlx` files in Dataform.\n\n\u003cbr /\u003e\n\nLearn [how and when Gemini\nfor Google Cloud uses your data](/gemini/docs/discover/data-governance).\nOnly English language prompts are supported for Gemini in Dataform.\n\n\u003cbr /\u003e\n\nThis document is intended for data analysts, data scientists, and data\ndevelopers who work with\n[workflows in Dataform](/dataform/docs/sql-workflows).\nIt assumes you have knowledge of Google SQL syntax and\nhow to create Dataform workflow actions.\n\nBefore you begin\n----------------\n\n1. In the Google Cloud console, go to the project selector page.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n2. Select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n3. [Activate Gemini in BigQuery](/gemini/docs/bigquery/set-up-gemini#activate).\n\n\u003cbr /\u003e\n\nGenerate a query\n----------------\n\n| As an early-stage technology, Gemini for Google Cloud\n| products can generate output that seems plausible but is factually incorrect. We recommend that you\n| validate all output from Gemini for Google Cloud products before you use it.\n| For more information, see\n| [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n\nYou can provide Gemini with a natural language statement (or\n*prompt* ) to generate a SQL or Dataform core query based on\n[workflow actions](/dataform/docs/sql-workflows) defined in your repository.\nFor example, you can use Gemini\nto generate a SQL `SELECT` statement in a `.sqlx` table definition file.\n\nTo generate a SQL or Dataform core query, follow these steps:\n\n1. In the Google Cloud console, go to the **Dataform** page.\n\n [Go to the Dataform page](https://console.cloud.google.com/bigquery/dataform)\n2. Select or [create a repository](/dataform/docs/create-repository),\n and then select or [create a workspace](/dataform/docs/create-workspace).\n\n3. In the **Files** pane, select or create a `.sqlx` file.\n\n4. In the file tab, click\n\n pen_spark\n **Gemini**.\n\n5. In the Gemini dialog, enter a natural language prompt.\n\n If you know the SQL action that you want to use, then you can specify\n the action name in backticks (`````) in your prompt.\n6. Click **Generate**.\n\n Gemini reviews the SQL actions defined in your repository\n to find actions that might be relevant to your prompt and suggests a query.\n7. Optional: To provide feedback, click thumb_up **Like suggestion** , thumb_down **Dislike suggestion** , or chat_info **Give more feedback**\n\n8. To accept the suggestion, click **Insert**.\n\n### Tips for query generation\n\nThe following tips can improve suggestions that Gemini in\nDataform provides:\n\n- Provide the SQL action name enclosed in backticks (`````), such as ``````action_name``````.\n- If the column names or their semantic relationships are unclear or complex, then you can provide context in the prompt to guide Gemini towards the answer that you want. This technique is known as *prompt engineering* . For example, to encourage a generated query to reference a column name, describe the column name and its relevance to the answer that you want. To encourage an answer that references complex terms like *lifetime value* or *gross\n margin*, describe the concept and its relevance to your data to improve SQL generation results.\n\n### Gemini and Dataform data\n\nGemini in Dataform can access the metadata of the\ntables that you have permission to access. This can include the table names,\ncolumn names, data types, and column descriptions. Gemini in\nDataform cannot access the data in your tables, views, or\nmodels. For more information on how Gemini uses your data, see\n[How Gemini for Google Cloud uses your\ndata](/gemini/docs/discover/data-governance).\n\nWhat's next\n-----------\n\n- For information about Gemini for Google Cloud, see [Gemini for Google Cloud overview](/gemini/docs/overview).\n- For information about the Gemini data policy, see [How Gemini for Google Cloud uses your data](/gemini/docs/discover/data-governance)."]]