create_job
¶
create_job(
name: NameString,
role: RoleString,
command: JobCommand,
*,
config_overrides: Optional[GlueClientConfig] = None,
job_mode: Optional[JobMode] = None,
job_run_queuing_enabled: Optional[NullableBoolean] = None,
description: Optional[DescriptionString] = None,
log_uri: Optional[UriString] = None,
execution_property: Optional[ExecutionProperty] = None,
default_arguments: Optional[GenericMap] = None,
non_overridable_arguments: Optional[GenericMap] = None,
connections: Optional[ConnectionsList] = None,
max_retries: Optional[MaxRetries] = None,
allocated_capacity: Optional[IntegerValue] = None,
timeout: Optional[Timeout] = None,
max_capacity: Optional[NullableDouble] = None,
security_configuration: Optional[NameString] = None,
tags: Optional[TagsMap] = None,
notification_property: Optional[NotificationProperty] = None,
glue_version: Optional[GlueVersionString] = None,
number_of_workers: Optional[NullableInteger] = None,
worker_type: Optional[WorkerType] = None,
code_gen_configuration_nodes: Optional[CodeGenConfigurationNodes] = None,
execution_class: Optional[ExecutionClass] = None,
source_control_details: Optional[SourceControlDetails] = None,
maintenance_window: Optional[MaintenanceWindow] = None,
) -> CreateJobResponse
Creates a new job definition.
Parameters:
-
name(NameString) –The name you assign to this job definition. It must be unique in your account.
-
job_mode(Optional[JobMode], default:None) –A mode that describes how a job was created. Valid values are:
-
SCRIPT- The job was created using the Glue Studio script editor. -
VISUAL- The job was created using the Glue Studio visual editor. -
NOTEBOOK- The job was created using an interactive sessions notebook.
When the
JobModefield is missing or null,SCRIPTis assigned as the default value. -
-
job_run_queuing_enabled(Optional[NullableBoolean], default:None) –Specifies whether job run queuing is enabled for the job runs for this job.
A value of true means job run queuing is enabled for the job runs. If false or not populated, the job runs will not be considered for queueing.
If this field does not match the value set in the job run, then the value from the job run field will be used.
-
description(Optional[DescriptionString], default:None) –Description of the job being defined.
-
log_uri(Optional[UriString], default:None) –This field is reserved for future use.
-
role(RoleString) –The name or Amazon Resource Name (ARN) of the IAM role associated with this job.
-
execution_property(Optional[ExecutionProperty], default:None) –An
ExecutionPropertyspecifying the maximum number of concurrent runs allowed for this job. -
command(JobCommand) –The
JobCommandthat runs this job. -
default_arguments(Optional[GenericMap], default:None) –The default arguments for every run of this job, specified as name-value pairs.
You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.
Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Secrets Manager or other secret management mechanism if you intend to keep them within the Job.
For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in Python topic in the developer guide.
For information about the arguments you can provide to this field when configuring Spark jobs, see the Special Parameters Used by Glue topic in the developer guide.
For information about the arguments you can provide to this field when configuring Ray jobs, see Using job parameters in Ray jobs in the developer guide.
-
non_overridable_arguments(Optional[GenericMap], default:None) –Arguments for this job that are not overridden when providing job arguments in a job run, specified as name-value pairs.
-
connections(Optional[ConnectionsList], default:None) –The connections used for this job.
-
max_retries(Optional[MaxRetries], default:None) –The maximum number of times to retry this job if it fails.
-
allocated_capacity(Optional[IntegerValue], default:None) –This parameter is deprecated. Use
MaxCapacityinstead.The number of Glue data processing units (DPUs) to allocate to this Job. You can allocate a minimum of 2 DPUs; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the Glue pricing page.
-
timeout(Optional[Timeout], default:None) –The job timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters
TIMEOUTstatus.Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.
When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.
Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.
For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.
-
max_capacity(Optional[NullableDouble], default:None) –For Glue version 1.0 or earlier jobs, using the standard worker type, the number of Glue data processing units (DPUs) that can be allocated when this job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the Glue pricing page.
For Glue version 2.0+ jobs, you cannot specify a
Maximum capacity. Instead, you should specify aWorker typeand theNumber of workers.Do not set
MaxCapacityif usingWorkerTypeandNumberOfWorkers.The value that can be allocated for
MaxCapacitydepends on whether you are running a Python shell job, an Apache Spark ETL job, or an Apache Spark streaming ETL job:-
When you specify a Python shell job (
JobCommand.Name="pythonshell"), you can allocate either 0.0625 or 1 DPU. The default is 0.0625 DPU. -
When you specify an Apache Spark ETL job (
JobCommand.Name="glueetl") or Apache Spark streaming ETL job (JobCommand.Name="gluestreaming"), you can allocate from 2 to 100 DPUs. The default is 10 DPUs. This job type cannot have a fractional DPU allocation.
-
-
security_configuration(Optional[NameString], default:None) –The name of the
SecurityConfigurationstructure to be used with this job. -
tags(Optional[TagsMap], default:None) –The tags to use with this job. You may use tags to limit access to the job. For more information about tags in Glue, see Amazon Web Services Tags in Glue in the developer guide.
-
notification_property(Optional[NotificationProperty], default:None) –Specifies configuration properties of a job notification.
-
glue_version(Optional[GlueVersionString], default:None) –In Spark jobs,
GlueVersiondetermines the versions of Apache Spark and Python that Glue available in a job. The Python version indicates the version supported for jobs of type Spark.Ray jobs should set
GlueVersionto4.0or greater. However, the versions of Ray, Python and additional libraries available in your Ray job are determined by theRuntimeparameter of the Job command.For more information about the available Glue versions and corresponding Spark and Python versions, see Glue version in the developer guide.
Jobs that are created without specifying a Glue version default to Glue 5.1.
-
number_of_workers(Optional[NullableInteger], default:None) –The number of workers of a defined
workerTypethat are allocated when a job runs. -
worker_type(Optional[WorkerType], default:None) –The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, G.8X or G.025X for Spark jobs. Accepts the value Z.2X for Ray jobs.
-
For the
G.1Xworker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 94GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs. -
For the
G.2Xworker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 138GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs. -
For the
G.4Xworker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs in the following Amazon Web Services Regions: US East (Ohio), US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), Europe (London), Europe (Spain), Europe (Stockholm), and South America (São Paulo). -
For the
G.8Xworker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs, in the same Amazon Web Services Regions as supported for theG.4Xworker type. -
For the
G.025Xworker type, each worker maps to 0.25 DPU (2 vCPUs, 4 GB of memory) with 84GB disk, and provides 1 executor per worker. We recommend this worker type for low volume streaming jobs. This worker type is only available for Glue version 3.0 or later streaming jobs. -
For the
Z.2Xworker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk, and provides up to 8 Ray workers based on the autoscaler.
-
-
code_gen_configuration_nodes(Optional[CodeGenConfigurationNodes], default:None) –The representation of a directed acyclic graph on which both the Glue Studio visual component and Glue Studio code generation is based.
-
execution_class(Optional[ExecutionClass], default:None) –Indicates whether the job is run with a standard or flexible execution class. The standard execution-class is ideal for time-sensitive workloads that require fast job startup and dedicated resources.
The flexible execution class is appropriate for time-insensitive jobs whose start and completion times may vary.
Only jobs with Glue version 3.0 and above and command type
glueetlwill be allowed to setExecutionClasstoFLEX. The flexible execution class is available for Spark jobs. -
source_control_details(Optional[SourceControlDetails], default:None) –The details for a source control configuration for a job, allowing synchronization of job artifacts to or from a remote repository.
-
maintenance_window(Optional[MaintenanceWindow], default:None) –This field specifies a day of the week and hour for a maintenance window for streaming jobs. Glue periodically performs maintenance activities. During these maintenance windows, Glue will need to restart your streaming jobs.
Glue will restart the job within 3 hours of the specified maintenance window. For instance, if you set up the maintenance window for Monday at 10:00AM GMT, your jobs will be restarted between 10:00AM GMT to 1:00PM GMT.
Raises:
-
AlreadyExistsException–A resource to be created or added already exists.
-
ConcurrentModificationException–Two processes are trying to modify a resource simultaneously.
-
IdempotentParameterMismatchException–The same unique identifier was associated with two different records.
-
InternalServiceException–An internal service error occurred.
-
InvalidInputException–The input provided was not valid.
-
OperationTimeoutException–The operation timed out.
-
ResourceNumberLimitExceededException–A resource numerical limit was exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_glue/_services/glue.py
3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 | |