SESSION: 11( youtube) Apache spark 2- pyspark chain.from_iterable



order=sc.textFile(“public/retail_db/orders”) x: x.encode(“ascii”, “ignore”).split(","))

order_value=chain.from_iterable(map(lambda x: x.split(","), orders))

TypeError: argument 2 to map() must support iteration



Don’t send personal messages. You will not get respond as I am not monitoring the topics on the community closely.

You cannot use chain.from_iterable like this. orders is RDD and chain.from_iterable expects typical Python collection.