Skip to content

Avoid to reset other parameters with updating a glue job

0

Hi everyone. I realized that when I use update job API, it resets other parameters! as AWS document says "The previous job definition is completely overwritten by this information". So, is there any way to only update dpu and timeout of the job without changing/resetting any other parameter?

actually I wanna do this: change only dup and timeout for next execution of jobs, then back them to what they were. thank you

asked 2 years ago367 views

1 Answer
0

Yes, there is a way to update specific parameters of an AWS Glue job, such as DPU (Data Processing Units) and timeout, without resetting or changing other parameters. However, you need to be careful with how you approach this due to the nature of the UpdateJob API.

The UpdateJob API does indeed completely overwrite the previous job definition with the new information provided. To avoid resetting other parameters, you should follow these steps:

  1. First, use the GetJob API to retrieve the current job definition and all its existing parameters.

  2. Create a JobUpdate object that includes all the current parameters from the GetJob response.

  3. Modify only the specific parameters you want to change in this JobUpdate object. In your case, you would update the MaxCapacity (which represents DPU) and Timeout fields.

  4. Use this modified JobUpdate object in your UpdateJob API call.

By following this approach, you're essentially sending back all the existing parameters along with your desired changes. This way, you're not inadvertently resetting any other parameters.

For example, if you're using a programming language like Python with the AWS SDK (boto3), your code might look something like this:

  1. Get the current job definition: existing_job = glue_client.get_job(JobName='your_job_name')

  2. Create a JobUpdate object with all existing parameters: job_update = existing_job['Job']

  3. Modify only the parameters you want to change: job_update['MaxCapacity'] = new_dpu_value job_update['Timeout'] = new_timeout_value

  4. Update the job with the modified JobUpdate object: glue_client.update_job(JobName='your_job_name', JobUpdate=job_update)

This method ensures that you're only updating the DPU and timeout while preserving all other existing parameters of your Glue job.
Sources
JobUpdate - AWS Glue
Jobs - AWS Glue
UpdateJob - AWS Glue

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.