Skip to content

Commit

Permalink
Added SQL File task to databricks_job resource (#2199)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Apr 6, 2023
1 parent cdb83b0 commit 39eb6fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/resources/job.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ One of the `query`, `dashboard` or `alert` needs to be provided.
* `query` - (Optional) block consisting of single string field: `query_id` - identifier of the Databricks SQL Query ([databricks_sql_query](sql_query.md)).
* `dashboard` - (Optional) block consisting of single string field: `dashboard_id` - identifier of the Databricks SQL Dashboard [databricks_sql_dashboard](sql_dashboard.md).
* `alert` - (Optional) block consisting of single string field: `alert_id` - identifier of the Databricks SQL Alert.
* `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*.

Example

Expand Down
5 changes: 5 additions & 0 deletions jobs/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ type SqlAlertTask struct {
AlertID string `json:"alert_id"`
}

type SqlFileTask struct {
Path string `json:"path"`
}

// SqlTask contains information about DBSQL task
// TODO: add validation & conflictsWith
type SqlTask struct {
Query *SqlQueryTask `json:"query,omitempty"`
Dashboard *SqlDashboardTask `json:"dashboard,omitempty"`
Alert *SqlAlertTask `json:"alert,omitempty"`
File *SqlFileTask `json:"file,omitempty"`
WarehouseID string `json:"warehouse_id,omitempty"`
Parameters map[string]string `json:"parameters,omitempty"`
}
Expand Down

0 comments on commit 39eb6fd

Please sign in to comment.