Hello

Please help take a look why my this simple reduce doesn't work?

rdd = sc.parallelize([("a",1),("b",2),("c",3)])

rdd.reduce(lambda x,y: x[1]+y[1])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/spark/python/pyspark/rdd.py", line 1001, in reduce
    return reduce(f, vals)
  File "/opt/spark/python/pyspark/util.py", line 74, in wrapper
    return f(*args, **kwargs)
  File "<stdin>", line 1, in <lambda>
TypeError: 'int' object is not subscriptable



spark 3.2.0

Thank you.

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscr...@spark.apache.org

Reply via email to