cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Streaming with Delta table source- definition of "File"?

Michael_Galli
Contributor III

Hi all,

I have a Delta Table as a Spark Streaming source.

This table contains signals on row level -> each signal is one append to the source table that creates a new version in the delta transaction history.

I am not really sure now how Spark streaming works if I define

spark

    .readStream

    .format("delta")

    .option("startingVersion", "latest")

    .option("maxFilesPerTrigger ", 100)

Are those the last 100 transactions from the delta transaction history? Or the last 100 parquet files?

Best regards

Michael

3 REPLIES 3

jose_gonzalez
Databricks Employee
Databricks Employee

Hi @Michael Galliโ€‹ ,

The maxFilesPerTrigger will measure how many new files to be considered in every micro-batch. The default is 1000. These will be the files associated to your Delta table. So, technically, these will be the parquet files.

Thx @Jose Gonzalezโ€‹ , this makes sense..

What I do not fully understand is the role of the Delta table transaction log in this matter.

E.g. maxFilesPerTrigger is set to 100 files for each micro-batch.

If the Delta transactions of the streaming source looks somewhat like this:UnbenanntE.g. there are 70 files per transaction. Will the micro batch 1 contain files from version 0 and 1, micro batch 2 contain files from version 1 and 2, and so on? So the Delta Table version is not really relevant for the streaming micro badge sizing?

Vidula
Honored Contributor

Hey there @Michael Galliโ€‹ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group