我必须调用 csv 文件来读取以下格式的数据帧,我可以读取正常的文件读取但使用 self 变量,我不知道。请帮助我们。
from pyspark.sql import SparkSession
class ChargePointsETLJob:
input_path = 'data/input/electric-chargepoints-2017.csv'
output_path = 'data/output/chargepoints-2017-analysis'
def __init__(self):
self.spark_session = (SparkSession.builder
.master("local[*]")
.appName("ElectricChargePointsETLJob")
.getOrCreate())
def extract(self):
pass
def transform(self, df):
pass
def load(self, df):
pass
def run(self):
self.load(self.transform(self.extract()))