Write and run pyspark in IntelliJ IDEA

后端 未结 3 1949
Happy的楠姐
Happy的楠姐 2021-02-15 16:26

i am trying to work with Pyspark in IntelliJ but i cannot figure out how to correctly install it/setup the project. I can work with Python in IntelliJ and I can use the pyspark

3条回答
  •  深忆病人
    2021-02-15 17:10

    For example, something of this kind:

    from pyspark import SparkContext, SparkConf
    spark_conf = SparkConf().setAppName("scavenge some logs")
    spark_context = SparkContext(conf=spark_conf)
    address = "/path/to/the/log/on/hdfs/*.gz"
    log = spark_context.textFile(address)
    
    my_result = (log.
    
    ...here go your actions and transformations...
    
    ).saveAsTextFile('my_result')
    

提交回复
热议问题