Skip to content

Commit 6291f7e

Browse files
authored
Improve job resource (#1428)
1 parent 699716a commit 6291f7e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

jobs/resource_job.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,36 @@ type PipelineTask struct {
5656
PipelineID string `json:"pipeline_id"`
5757
}
5858

59+
type sqlQuery struct {
60+
QueryID string `json:"query_id"`
61+
}
62+
63+
type sqlDashboard struct {
64+
DashboardID string `json:"dashboard_id"`
65+
}
66+
67+
type sqlAlert struct {
68+
AlertID string `json:"alert_id"`
69+
}
70+
71+
// SqlTask contains information about DBSQL task
72+
// TODO: add validation & conflictsWith
73+
type SqlTask struct {
74+
Query *sqlQuery `json:"query,omitempty"`
75+
Dashboard *sqlDashboard `json:"dashboard,omitempty"`
76+
Alert *sqlAlert `json:"alert,omitempty"`
77+
WarehouseID string `json:"warehouse_id,omitempty"`
78+
Parameters map[string]string `json:"parameters,omitempty"`
79+
}
80+
81+
// DbtTask contains information about DBT task
82+
// TODO: add validation for non-empty commands
83+
type DbtTask struct {
84+
ProjectDirectory string `json:"project_directory,omitempty"`
85+
Commands []string `json:"commands"`
86+
Schema string `json:"schema,omitempty" tf:"default:default"`
87+
}
88+
5989
// EmailNotifications contains the information for email notifications after job completion
6090
type EmailNotifications struct {
6191
OnStart []string `json:"on_start,omitempty"`
@@ -102,6 +132,8 @@ type JobTaskSettings struct {
102132
SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty" tf:"group:task_type"`
103133
PipelineTask *PipelineTask `json:"pipeline_task,omitempty" tf:"group:task_type"`
104134
PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty" tf:"group:task_type"`
135+
SqlTask *SqlTask `json:"sql_task,omitempty" tf:"group:task_type"`
136+
DbtTask *DbtTask `json:"dbt_task,omitempty" tf:"group:task_type"`
105137
EmailNotifications *EmailNotifications `json:"email_notifications,omitempty" tf:"suppress_diff"`
106138
TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
107139
MaxRetries int32 `json:"max_retries,omitempty"`

sql/resource_sql_endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type SQLEndpoint struct {
2929
MaxNumClusters int `json:"max_num_clusters,omitempty" tf:"default:1"`
3030
NumClusters int `json:"num_clusters,omitempty" tf:"default:1,suppress_diff"`
3131
EnablePhoton bool `json:"enable_photon" tf:"default:true"`
32-
EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty"`
32+
EnableServerlessCompute bool `json:"enable_serverless_compute,omitempty" tf:"suppress_diff"`
3333
InstanceProfileARN string `json:"instance_profile_arn,omitempty"`
3434
State string `json:"state,omitempty" tf:"computed"`
3535
JdbcURL string `json:"jdbc_url,omitempty" tf:"computed"`

0 commit comments

Comments
 (0)