Hello @JasonW-5564 !
Suppose your recent file is 'https://<storage-account>.dfs.core.windows.net/<file-system>/<path>/recentfile.parquet'
As you already know we can use :
SELECT * FROM
OPENROWSET(
BULK '<file-path>',
FORMAT => 'PARQUET'
) AS [result]
To identify the file use the serverless SQL pool :
WITH FileNames AS (
SELECT
filename() AS FileName,
-- Parse the timestamp from the file name
SUBSTRING(
filename(),
CHARINDEX('TimekeeperAttribute_', filename()) + 20,
24
) AS FileTimestamp
FROM
OPENROWSET(
BULK 'https://<storage-account-name>.dfs.core.windows.net/<file-system-name>/<directory-path>/*.parquet',
FORMAT='PARQUET'
) AS [result]
)
SELECT TOP 1
FileName
FROM
FileNames
ORDER BY
FileTimestamp DESC;
I took the code from another Job with CSV i was using and modified it
Can you please give it a go ?
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards