简体   繁体   中英

Providing params in AWS Glue interactive session

I am trying to develop an AWS Glue job in pyspark using interactive sessions in AWS Glue. To use job.init , I have seen in examples that the JOB_NAME is passed like so

args = getResolvedOptions(sys.argv, ['JOB_NAME'])
...
job.init(args['JOB_NAME'], args)

a) When I run the notebook in the Glue Studio Editor, I get: GlueArgumentError: the following arguments are required: --JOB_NAME . How do I set the parameter without running the whole job?

b) Ultimately, I want to develop in VS Code. Is there a way to set the JOB_NAME parameter there?

In your Glue Interactive sessions notebook you can add required arguments manually by updating the sys.argv. See the example below:

sys.argv+=['--JOB_NAME', 'my_test_job']
args = getResolvedOptions(sys.argv,
                          ['JOB_NAME'])
print(args)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM