Not able to copy /paste and run multiple commands in CYGWIN64

pyspark

#1

Hold on, read this through before raising topic in this category

I am not able to execute after copy pasting multi lines of pyspark code as Raju sir is doing during the training session.I tried to search available command but didn’t find anything that will help me.
I am missing something in setup or there is any command that I have to issues before copy pasting multi line commands and execute it ?

Thanks,
Sushital


#2

@sushital1997 Can you share the commands which your are trying?


#3

suppose I am trying paste this block and want to execute …

products = sc.textFile("/public/retail_db/products")
productsFilter = products.
filter(lambda p:p.split(",")[4] != “”)
topNProducts = productsFilter.takeOrdered(5,key=lambda k: -float(k.split(",")[4]))
for i in topNProducts: print(i)

but its giving error.so I have to type each command line and proceed
I think there should be some command or setup in Cygwin which I am missing or don’t know to input commands in multiple lines


#4

@sushital1997 Try below command. Use Shift+Insert to paste the script.

products = sc.textFile("/public/retail_db/products")
productsFilter = products. \
filter(lambda p:p.split(",")[4] != “”)
topNProducts = productsFilter.takeOrdered(5,key=lambda k: -float(k.split(",")[4]))
for i in topNProducts: print(i)