AKSHAY SHINGOTE
AKSHAY SHINGOTE

Reputation: 407

Giving input_file_path argument to glue from Glue console

I want to pass an s3 filename as an input_file_path which I want to execute job from Glue console.Is their any way to give input_file_path argument from AWS Glue console?

Upvotes: 1

Views: 1681

Answers (1)

botchniaque
botchniaque

Reputation: 5104

If you want to create job parameter via Glue Console (UI), you have to first define the argument in the job:

  • unfold the Script libraries and job parameters sections enter image description here

  • enter your parameter: enter image description here

  • Read it in your code (Scala example):

    def main(sysArgs: Array[String]) {
      val args = GlueArgParser.getResolvedOptions(sysArgs, Array("input_file_path"))
      print(s"Input path: ${args("input_file_path")}")
    }
    
  • Read it in your code (Python):

    import sys
    
    args = getResolvedOptions(sys.argv, ['input_file_path'])
    print(args['input_file_path'])
    

Upvotes: 3

Related Questions