<?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 Infer schema eliminating leading zeros. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/infer-schema-eliminating-leading-zeros/m-p/66307#M33081</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Upon reading a CSV file with schema inference enabled, I've noticed that a column originally designated as string datatype contains numeric values with leading zeros. However, upon reading the data to Pyspark data frame, it undergoes automatic conversion to integers, resulting in the removal of the leading zeros.&lt;BR /&gt;&lt;BR /&gt;How can I resolve this issue without passing the external schema while reading.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 07:00:04 GMT</pubDate>
    <dc:creator>AnkithP</dc:creator>
    <dc:date>2024-04-16T07:00:04Z</dc:date>
    <item>
      <title>Infer schema eliminating leading zeros.</title>
      <link>https://community.databricks.com/t5/data-engineering/infer-schema-eliminating-leading-zeros/m-p/66307#M33081</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Upon reading a CSV file with schema inference enabled, I've noticed that a column originally designated as string datatype contains numeric values with leading zeros. However, upon reading the data to Pyspark data frame, it undergoes automatic conversion to integers, resulting in the removal of the leading zeros.&lt;BR /&gt;&lt;BR /&gt;How can I resolve this issue without passing the external schema while reading.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 07:00:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/infer-schema-eliminating-leading-zeros/m-p/66307#M33081</guid>
      <dc:creator>AnkithP</dc:creator>
      <dc:date>2024-04-16T07:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Infer schema eliminating leading zeros.</title>
      <link>https://community.databricks.com/t5/data-engineering/infer-schema-eliminating-leading-zeros/m-p/66442#M33113</link>
      <description>&lt;P&gt;if you set .option("inferSchema", "false") all columns will be read as string.&lt;BR /&gt;You will have to cast all the other columns to their appropriate type though.&amp;nbsp; So passing a schema seems easier to me.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 11:51:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/infer-schema-eliminating-leading-zeros/m-p/66442#M33113</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-04-17T11:51:37Z</dc:date>
    </item>
  </channel>
</rss>

