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: 

Last file in S3 folder using autoloader

Miguel_Salas
New Contributor II

Nowadays we already use the autoloader with checkpoint location, but I still wanted to know if it is possible to read only the last updated file within a folder. I know it somewhat loses the purpose of checkpoint locatio
Another question is it possible to obtain any information if the autoloader returns an empty dataframe without having to run a count on the dataframe? Some parameter of how many files or mb were read.

1 REPLY 1

cgrant
Databricks Employee
Databricks Employee

Auto loader's scope is limited to incrementally loading files from storage, and there is no such functionality to just load the latest file from a group of files, you'd likely want to have this kind of "last updated" logic in a different layer or in flight by using stateful processing or some other foreachBatch logic.

For autoloader metrics, please look here. The gist of it is that after each batch, metrics are emitted including the number of records, time spent processing, and backlog.

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