SQLレシピの構築¶
The SQL Editor allows you to create a recipe comprised of SQL queries that enrich, transform, shape, and blend datasets together, which you can then publish to create a new output dataset.
To open the SQL Editor, click the Actions menu next to the dataset you want to work with and select Open SQL Editor.
要素 | 説明 | |
---|---|---|
1 | 情報タブ | Displays summary information and metadata for the SQL recipe. |
2 | データ入力タブ | Displays the data inputs and feature menu for associated with the SQL recipe. |
3 | データを追加 | Adds data inputs—from the same data engine—to the recipe. |
4 | データ入力 | Lists all data inputs currently added to the recipe. |
5 | Feature menu | Displays the features of the selected data input. |
6 | エディター | Allows you to enter SQL queries to manipulate your data. |
7 | プレビュー | Displays a preview of the above SQL queries. |
8 | データエンジン | SQLクエリの実行に使用されるデータエンジンを表示します。 |
9 | SQLリファレンスドキュメント | Links to the SQL reference documentation of the appropriate data engine. |
10 | 実行 | Runs the SQL queries entered into the editor to update the preview. |
11 | レシピのアクション |
You can also customize your view by clicking the Settings icon , which allows you to hide or display the following elements in the editor.
データ入力を追加¶
プライマリーデータセットを充実させるために、元のデータセットと同じデータエンジンからデータ入力を追加できます。 The original dataset is always positioned at the top of the data input list.
データ入力を追加するには:
- データを追加をクリックします。
-
Select the data you want to add. You can make multiple selections at a time. 以下の点に注意してください。
- If you're adding data from a live source, you must select the schema and table(s).
- If you're adding data to work with using the Spark engine (i.e., datasets), select one or more snapshotted or static datasets already associated with the current Use Case or that's in the Data Registry.
-
右上隅のデータ入力を追加をクリックします。 All data inputs appear in the panel on the left.
データ入力を編集¶
To edit a data input, hover over the one you want to modify and click the pencil icon .
The metadata included in the Information section is different depending on whether the input is a static dataset or a live data source. 詳細は以下のタブをご覧ください。
If the input is a static or snapshot dataset, the Information section displays the following:
フィールド | 説明 |
---|---|
データセット名 | The name of the dataset in DataRobot. |
データセットID | The unique ID for the dataset in DataRobot. |
作成日時 | The date and time the dataset was created in DataRobot. |
If the input is a live data source, the Information section displays the following:
フィールド | 説明 |
---|---|
データ接続名 | The name of the data connection associated with the data. |
フルパス | The full path of the data including the database, schema, and table. |
The edit options are different for original data inputs and those added in the SQL Editor.
When editing the original data input, you have the following edit options:
要素 | 説明 | |
---|---|---|
1 | エイリアス名 | |
2 | スナップショットポリシー | |
3 | サンプリング方法 | |
4 | 行数 | Enter the number of rows to pull from the source data for the sample. |
5 | アクション | The following actions are available when editing a data input:
|
When editing a secondary data input, you have the following edit options:
要素 | 説明 | |
---|---|---|
1 | エイリアス名 | |
2 | スナップショットポリシー |
時間認識データ入力を編集¶
If the original data input is time-aware, and you select Date/time as the sampling method, there are additional fields that must be filled in. 詳細については、[時間認識ラングリング]{0}に関するドキュメントを参照してください。
クエリーの作成¶
Once you've added data inputs, you can begin adding SQL queries to the editor. To access the SQL reference for your data engine, click the documentation icon .
Live data
If you are connected to a live data source (e.g., Snowflake, Databricks, or BigQuery), you can reference the full path from the data source to use them in the SQL query instead of adding inputs. The path must include the database, schema, and table name.
You can reference data inputs you've added using only the alias without providing the full path.
クエリを入力するには、SQLクエリ構文を手動でエディタに入力するか、パネルを使用して特徴量を追加します。
パネルからの特徴量の追加¶
To add features from a data input, select the data input from the list. The panel below updates to display the features from the selected input.
このメニューからは、以下の操作を行うことができます。
要素 | 説明 | |
---|---|---|
1 | エディターに名前を配置 | Adds the name of the data input. |
2 | エディターにすべての特徴量を配置 | Adds every feature in the data input. |
3 | データをプレビュー | Opens a dataset preview in a separate, larger modal so that you can more easily analyze the features in your dataset. |
4 | 特徴量を個別に追加します。 |
パネルを使用して特徴量を追加すると、追加された特徴量がカーソルの位置でSQLエディターに移動します。
結果のプレビュー¶
クエリーが完了したら、実行をクリックします。
プレビューで他の行を表示するには、ウィンドウシェードスクロールを使用します。行のすべての列をスクロールするには、水平スクロールバーを使用します。
クエリーが正常に実行されなかった場合、通知バナーが表示されます。
パブリッシュ¶
From here, you can [publish your SQL recipe]{0} to generate an output dataset.