Can I add arguments to python code when I submit spark job?

后端 未结 5 1398
予麋鹿
予麋鹿 2020-12-28 13:24

I\'m trying to use spark-submit to execute my python code in spark cluster.

Generally we run spark-submit with python code like below.

5条回答
  •  滥情空心
    2020-12-28 13:31

    Yes: Put this in a file called args.py

    #import sys
    print sys.argv
    

    If you run

    spark-submit args.py a b c d e 
    

    You will see:

    ['/spark/args.py', 'a', 'b', 'c', 'd', 'e']
    

提交回复
热议问题