[Python] ValueError: RDD is empty-- Pyspark (Windows Standalone)

Discussão em 'Python' iniciado por Stack, Setembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to create an RDD but spark not creating it, throwing back error, pasted below;

    data = records.map(lambda r: LabeledPoint(extract_label(r), extract_features(r)))
    first_point = data.first()

    Py4JJavaError Traceback (most recent call last)
    <ipython-input-19-d713906000f8> in <module>()
    ----> 1 first_point = data.first()
    2 print "Raw data: " + str(first[2:])
    3 print "Label: " + str(first_point.label)
    4 print "Linear Model feature vector:\n" + str(first_point.features)
    5 print "Linear Model feature vector length: " + str(len (first_point.features))

    C:\spark\python\pyspark\rdd.pyc in first(self)
    1313 ValueError: RDD is empty
    1314 """
    -> 1315 rs = self.take(1)
    1316 if rs:
    1317 return rs[0]

    C:\spark\python\pyspark\rdd.pyc in take(self, num)
    1295
    1296 p = range(partsScanned, min(partsScanned + numPartsToTry, totalParts))
    -> 1297 res = self.context.runJob(self, takeUpToNumLeft, p)..................


    Any help will be greatly appreciated.

    Thank you, Innocent

    Continue reading...

Compartilhe esta Página