<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Schema inferrence CSV picks up \r carriage returns in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/schema-inferrence-csv-picks-up-r-carriage-returns/m-p/16696#M10826</link>
    <description>&lt;P&gt;Files saved in Windows operation system contain carriage return and line feed in every line.&lt;/P&gt;&lt;P&gt;Please add following option it can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; .option("ignoreTrailingWhiteSpace", true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2021 12:47:52 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2021-11-22T12:47:52Z</dc:date>
    <item>
      <title>Schema inferrence CSV picks up \r carriage returns</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-inferrence-csv-picks-up-r-carriage-returns/m-p/16695#M10825</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt; I'm using:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;
    frame = spark.read.csv(path=bucket+folder,
                                   inferSchema = True,
                                   header = True,
                                   multiLine=True
     )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to read in a series of CSV files.&lt;/P&gt;
&lt;P&gt;For one of my column headers, the parser is picking up a \r in the column name when I dig into the schema. Note "finalLink\r" in the schema listing:&lt;/P&gt;[.......k', 'StringType'), ('finalLink\r', 'StringType'), # this is the \r ('period_p', 'StringType'), ('year_p', 'IntegerType')] 
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;What flags should I be using in order to avoid parsing the carriage returns? It could be that there is juust an extra one in one of the CSV files but am not sure what is causing it.&lt;/P&gt;
&lt;P&gt;Lee&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 19:45:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-inferrence-csv-picks-up-r-carriage-returns/m-p/16695#M10825</guid>
      <dc:creator>lprevost</dc:creator>
      <dc:date>2021-08-09T19:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Schema inferrence CSV picks up \r carriage returns</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-inferrence-csv-picks-up-r-carriage-returns/m-p/16696#M10826</link>
      <description>&lt;P&gt;Files saved in Windows operation system contain carriage return and line feed in every line.&lt;/P&gt;&lt;P&gt;Please add following option it can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; .option("ignoreTrailingWhiteSpace", true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 12:47:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-inferrence-csv-picks-up-r-carriage-returns/m-p/16696#M10826</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-11-22T12:47:52Z</dc:date>
    </item>
  </channel>
</rss>

