Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import luigi
- from luigi.contrib.spark import PySparkTask
- class SinglePySparkTask(PySparkTask):
- task_namespace = 'spark'
- def main(self, sc, *args):
- """
- :type sc: pyspark.context.SparkContext
- """
- rdd = sc.parallelize([1, 2, 3])
- print(rdd.collect())
- if name == "main":
- luigi.build([SinglePySparkTask(), ], local_scheduler=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement