title: How can pyspark infer double quoted integers with leading zeros (eg. 000000038473) as string?
body: <p>Trying to infer schema with pyspark using infer schema :</p>
  <pre><code>self.spark.read.option('inferSchema', 'true')
  </code></pre>
  <p>But when the number has double quote, pyspark infers integer instead of string (for example when the number has &quot;leading zeros&quot;). In this case, i want Pyspark to infer strings, not integers.</p>
  <p>How can i force pyspark to understand that this is a string, without removing the inferSchema.</p>
  <p><strong>i want to keep InferSchema. It is helpful for other columns, eg. floats, or other integers. We are doing a type detection kind of ingestion.</strong></p>
  <p><a href="https://i.stack.imgur.com/5EPsh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5EPsh.png" alt="enter image description here" /></a></p>
  <p>The only way i found so far is by using :</p>
  <ul>
  <li><code>option(&quot;quote&quot;,&quot;&quot;)</code> when reading, which put double quote on every string and <strong>every number having leading zeros</strong>.</li>
  <li>Then i have to remove these double quotes which ugly <code>regexp_replace</code> such as eg : <code>regexp_replace(SNumber,'&quot;','') as s_number</code> on each of these
  columns.</li>
  </ul>
  <p>Is there a better way to do it ? <strong>We don't want to define a schema and &quot;apply schema&quot; at this stage.</strong></p>
  <p>Many thanks in advance !</p>