<?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: maxFilesPerTrigger not working while loading data from Unity Catalogue table in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85806#M8211</link>
    <description>&lt;P&gt;How does your table structure look like, can you confirm that all your data is actually in more than just two files?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 13:03:50 GMT</pubDate>
    <dc:creator>Witold</dc:creator>
    <dc:date>2024-08-28T13:03:50Z</dc:date>
    <item>
      <title>maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85794#M8210</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using streaming on unity catalogue tables and trying to limit the number of records read in each batch. Here is my code but its not respecting&amp;nbsp;&lt;SPAN&gt;maxFilesPerTrigger, instead reads all available data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(spark.readStream&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"skipChangeCommits"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"true"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;option&l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lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;(table_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.writeStream&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"checkpointLocation"&lt;/SPAN&gt;&lt;SPAN&gt;, checkpoint_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;trigger&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;availableNow&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;foreachBatch&lt;/SPAN&gt;&lt;SPAN&gt;(foreachBatchFunction)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;start&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;awaitTermination&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Appreciate any help here.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Aug 2024 12:08:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85794#M8210</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-08-28T12:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85806#M8211</link>
      <description>&lt;P&gt;How does your table structure look like, can you confirm that all your data is actually in more than just two files?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:03:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85806#M8211</guid>
      <dc:creator>Witold</dc:creator>
      <dc:date>2024-08-28T13:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85882#M8212</link>
      <description>&lt;P&gt;My table has multiple rows e.g. lets take simple table as employee with emd_id &amp;amp; emp_name columns and use streaming to process any updates to this table. In case there are more than 2 inserts, i want to process max 2 rows at a time&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 17:02:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/85882#M8212</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-08-28T17:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86222#M8213</link>
      <description>&lt;P&gt;am able to resolve the issue. not sure what was the issue. Its working now without any code change.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 07:31:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86222#M8213</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-08-29T07:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86228#M8214</link>
      <description>&lt;P&gt;I believe you misunderstand the fundamentals of delta tables. `maxFilesPerTrigger` has nothing to do with how many rows you will process at the same time. And if you really want to control the number of records per file, then you need to adapt the writer accordingly. Besides that fact that having two records per file is a very bad idea for multiple reasons. Depending on your load, you will end up with thousand of small files and dozens of useless history entries in the delta table log.&lt;/P&gt;&lt;P&gt;Of course I don't know your use case behind it, but I'm pretty sure that you don't want to process two rows at the same. Keep in mind that you're in a big data environment, and it's designed to process millions of rows at the same time.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 07:36:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86228#M8214</guid>
      <dc:creator>Witold</dc:creator>
      <dc:date>2024-08-29T07:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: maxFilesPerTrigger not working while loading data from Unity Catalogue table</title>
      <link>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86231#M8215</link>
      <description>&lt;P&gt;Thank you Witold, 2 was just an example. I am having thousands of files coming every second and want to limit files per batch otherwise process gets struct if there are too many files in given batch.&lt;/P&gt;&lt;P&gt;I am able to limit the batch size while running single job but not as continuous job.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;(spark.readStream&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"skipChangeCommits"&lt;/SPAN&gt;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;(&lt;/SPAN&gt;&lt;SPAN&gt;"maxFilesPerTrigger"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;(table_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.writeStream&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"checkpointLocation"&lt;/SPAN&gt;&lt;SPAN&gt;, checkpoint_path)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;.trigger(processingTime="1 second")&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;.foreachBatch(foreachBatchFunction)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;start&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Aug 2024 07:46:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/maxfilespertrigger-not-working-while-loading-data-from-unity/m-p/86231#M8215</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-08-29T07:46:57Z</dc:date>
    </item>
  </channel>
</rss>

