How do you pass parameters into the python script being called in a dataproc pyspark job submit? Here is a cmd I've been mucking with:
gcloud dataproc jobs submit pyspark --cluster my-dataproc \
file:///usr/test-pyspark.py \
--properties=^:^p1="7day":p2="2017-10-01"
This is the output returned:
Job [vvvvvvv-vvvv-vvvv-vvvv-0vvvvvv] submitted. Waiting for job output...
Warning: Ignoring non-spark config property: p2=2017-10-01
Warning: Ignoring non-spark config property: p1=7day
Found script=/usr/test-pyspark.py
Traceback (most recent call last):
File "/usr/test-pyspark.py", line 52, in <module>
print(sys.argv[1])
IndexError: list index out of range`
Clearly doesn't recognize the 2 params I'm trying to pass in. I also tried:
me@my-dataproc-m:~$ gcloud dataproc jobs submit pyspark --cluster=my-dataproc test-pyspark.py 7day 2017-11-01
But that returned with:
ERROR: (gcloud.dataproc.jobs.submit.pyspark) unrecognized arguments:
7day
2017-11-01
The pattern I use to pass params with the hive jobs doesn't work for pyspark.
Any help appreciated!
Thanks, Melissa