Skip to content

Commit 39eb6fd

Browse files
authored
Added SQL File task to databricks_job resource (#2199)
1 parent cdb83b0 commit 39eb6fd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/resources/job.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ One of the `query`, `dashboard` or `alert` needs to be provided.
214214
* `query` - (Optional) block consisting of single string field: `query_id` - identifier of the Databricks SQL Query ([databricks_sql_query](sql_query.md)).
215215
* `dashboard` - (Optional) block consisting of single string field: `dashboard_id` - identifier of the Databricks SQL Dashboard [databricks_sql_dashboard](sql_dashboard.md).
216216
* `alert` - (Optional) block consisting of single string field: `alert_id` - identifier of the Databricks SQL Alert.
217+
* `file` - (Optional) block consisting of single string field: `path` - a relative path to the file (inside the Git repository) with SQL commands to execute. *Requires `git_source` configuration block*.
217218

218219
Example
219220

jobs/resource_job.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,17 @@ type SqlAlertTask struct {
7272
AlertID string `json:"alert_id"`
7373
}
7474

75+
type SqlFileTask struct {
76+
Path string `json:"path"`
77+
}
78+
7579
// SqlTask contains information about DBSQL task
7680
// TODO: add validation & conflictsWith
7781
type SqlTask struct {
7882
Query *SqlQueryTask `json:"query,omitempty"`
7983
Dashboard *SqlDashboardTask `json:"dashboard,omitempty"`
8084
Alert *SqlAlertTask `json:"alert,omitempty"`
85+
File *SqlFileTask `json:"file,omitempty"`
8186
WarehouseID string `json:"warehouse_id,omitempty"`
8287
Parameters map[string]string `json:"parameters,omitempty"`
8388
}

0 commit comments

Comments
 (0)