Skip to content

Commit fe08aa9

Browse files
authored
feat(glue): support glue version 4.0 (#23223)
https://aws.amazon.com/blogs/aws/new-aws-glue-4-0-new-and-updated-engines-more-data-formats-and-more/ closes #23220 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent eb6fd03 commit fe08aa9

File tree

10 files changed

+2127
-168
lines changed

10 files changed

+2127
-168
lines changed

packages/@aws-cdk/aws-glue/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ An ETL job processes data in batches using Apache Spark.
4545
declare const bucket: s3.Bucket;
4646
new glue.Job(this, 'ScalaSparkEtlJob', {
4747
executable: glue.JobExecutable.scalaEtl({
48-
glueVersion: glue.GlueVersion.V2_0,
48+
glueVersion: glue.GlueVersion.V4_0,
4949
script: glue.Code.fromBucket(bucket, 'src/com/example/HelloWorld.scala'),
5050
className: 'com.example.HelloWorld',
5151
extraJars: [glue.Code.fromBucket(bucket, 'jars/HelloWorld.jar')],
@@ -61,7 +61,7 @@ A Streaming job is similar to an ETL job, except that it performs ETL on data st
6161
```ts
6262
new glue.Job(this, 'PythonSparkStreamingJob', {
6363
executable: glue.JobExecutable.pythonStreaming({
64-
glueVersion: glue.GlueVersion.V2_0,
64+
glueVersion: glue.GlueVersion.V4_0,
6565
pythonVersion: glue.PythonVersion.THREE,
6666
script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),
6767
}),

packages/@aws-cdk/aws-glue/lib/job-executable.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export class GlueVersion {
2929
*/
3030
public static readonly V3_0 = new GlueVersion('3.0');
3131

32+
/**
33+
* Glue version using Spark 3.3.0 and Python 3.10
34+
*/
35+
public static readonly V4_0 = new GlueVersion('4.0');
36+
3237
/**
3338
* Custom Glue version
3439
* @param version custom version
@@ -292,7 +297,7 @@ export class JobExecutable {
292297
if (config.language !== JobLanguage.PYTHON) {
293298
throw new Error('Python shell requires the language to be set to Python');
294299
}
295-
if ([GlueVersion.V0_9, GlueVersion.V2_0, GlueVersion.V3_0].includes(config.glueVersion)) {
300+
if ([GlueVersion.V0_9, GlueVersion.V2_0, GlueVersion.V3_0, GlueVersion.V4_0].includes(config.glueVersion)) {
296301
throw new Error(`Specified GlueVersion ${config.glueVersion.name} does not support Python Shell`);
297302
}
298303
}

packages/@aws-cdk/aws-glue/test/integ.job.js.snapshot/aws-glue-job.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "22.0.0",
33
"files": {
44
"432033e3218068a915d2532fa9be7858a12b228a2ae6e5c10faccd9097b1e855": {
55
"source": {
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"3d4fb124b6f262a7f5f621715b1437dcf5af3450121d622990f89e94fd55d8f5": {
17+
"0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4": {
1818
"source": {
1919
"path": "aws-glue-job.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "3d4fb124b6f262a7f5f621715b1437dcf5af3450121d622990f89e94fd55d8f5.json",
25+
"objectKey": "0985af21379e9d6e1cba091105ecb533ee38a96b4c738816daf17d951a0752b4.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

0 commit comments

Comments
 (0)