title: Spark-SQL : How to read a TSV or CSV file into dataframe and apply a custom schema?
body: <p>I'm using Spark 2.0 while working with tab-separated value (TSV) and comma-separated value (CSV) files. I want to load the data into Spark-SQL dataframes, where I would like to control the schema completely when the files are read. I don't want Spark to guess the schema from the data in the file.</p>
  
  <p>How would I load TSV or CSV files into Spark SQL Dataframes and apply a schema to them?</p>