<?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 How many records does Spark use to infer the schema? entire file or just the first &amp;quot;X&amp;quot; number of records? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-many-records-does-spark-use-to-infer-the-schema-entire-file/m-p/21690#M14821</link>
    <description>&lt;P&gt;It depends.&lt;/P&gt;&lt;P&gt; If you specify the schema it will be zero, otherwise it will do a full file scan which doesn’t work well processing Big Data at a large scale.&lt;/P&gt;&lt;P&gt;CSV files Dataframe Reader &lt;A href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameReader.csv.html?highlight=dataframereader#pyspark-sql-dataframereader-csv" target="test_blank"&gt;https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameReader.csv.html?highlight=dataframereader#pyspark-sql-dataframereader-csv&lt;/A&gt; samplingRatio&lt;B&gt; will let you change how you sample the data on inference.&lt;/B&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 23:09:52 GMT</pubDate>
    <dc:creator>User15787040559</dc:creator>
    <dc:date>2021-06-22T23:09:52Z</dc:date>
    <item>
      <title>How many records does Spark use to infer the schema? entire file or just the first "X" number of records?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-many-records-does-spark-use-to-infer-the-schema-entire-file/m-p/21690#M14821</link>
      <description>&lt;P&gt;It depends.&lt;/P&gt;&lt;P&gt; If you specify the schema it will be zero, otherwise it will do a full file scan which doesn’t work well processing Big Data at a large scale.&lt;/P&gt;&lt;P&gt;CSV files Dataframe Reader &lt;A href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameReader.csv.html?highlight=dataframereader#pyspark-sql-dataframereader-csv" target="test_blank"&gt;https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameReader.csv.html?highlight=dataframereader#pyspark-sql-dataframereader-csv&lt;/A&gt; samplingRatio&lt;B&gt; will let you change how you sample the data on inference.&lt;/B&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 23:09:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-many-records-does-spark-use-to-infer-the-schema-entire-file/m-p/21690#M14821</guid>
      <dc:creator>User15787040559</dc:creator>
      <dc:date>2021-06-22T23:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How many records does Spark use to infer the schema? entire file or just the first "X" number of records?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-many-records-does-spark-use-to-infer-the-schema-entire-file/m-p/21691#M14822</link>
      <description>&lt;P&gt;As indicated there are ways to manage the amount of data being sampled for inferring schema. However as a best practice for production workloads its always best to define the schema explicitly for consistency, repeatability and robustness of the pipelines. It also helps with implementing effective data quality checks using features like schema enforcement and expectations in Delta Live Tables&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 04:09:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-many-records-does-spark-use-to-infer-the-schema-entire-file/m-p/21691#M14822</guid>
      <dc:creator>aladda</dc:creator>
      <dc:date>2021-06-23T04:09:15Z</dc:date>
    </item>
  </channel>
</rss>

