The reason you are able to load employee.parquet and not employee.txt using load is that spark.read.load by default assumes that data source is in parquet format so it is able to load it but we can use format function which can be used to specify the different format and use the load function to load the data. Refer to this code:
val a =spark.read.format("csv").load("employee.txt")