I have to read a file which is in the HDFS and convert it to a data frame . I am doing the below steps. But unable to go ahead. Need some help.
from pyspark.sql import SparkSession
stock1 = spark.read.csv("/FileStore/tables/stockdata/companylist_noheader.csv")
When I do so I get the below output
But the actual csv file is like below The input
Please suggest. I know we have a | delimited but when I use a map function I get the below error attributeError: 'DataFrame' object has no attribute 'map'