Suppose I have multiple ZIP files being uploaded onto some directory within an AWS S3 bucket. Each file also has various custom metadata that have been assigned to it during upload. I want to set up an ETL pipeline where I periodially extract any newly uploaded files for process. Spark's Auto Loader seems like a good tool for this job, though I also need the files' custom metadata. Is this possible through Spark's Auto Loader? I've been searching and searching but can't find anything relating reading custom metadata.
Related
I am building a pipeline to copy files from Sharepoint to Azule Blob Storage at work.
After reading some documentation, I was able to create a pipeline that only copies certain files.
However, I would like to automate this pipeline by using dynamic file paths to specify the source files in Sharepoint.
In other words, when I run the pipeline on 2022/07/14, I want to get the files from the Sharepoint folder named for that day, such as "Data/2022/07/14/files".
I know how to do this with PowerAutomate, but my company does not want me to use PowerAutomate.
The current pipeline looks like the attached image.
Do I need to use parameters in the URL of the source dataset?
Any help would be appreciated.
Thank you.
Try this approach.
You can create a parameterized dataset as below
Then from the copy activity you can give the file path to this parameter
as
#concat('Data/',formatDateTime(utcnow(),'yyyy'),'/',formatDateTime(utcnow(),'MM'),'/',formatDateTime(utcnow(),'dd'))
1.) I'd like to get configuration file from repository files to start service according to configuration. However, as I see it doesn't see repository files when the services are started at first. Is there a way to do that? or Can I mount a folder or volume to service?
2.) After that, I just want to get service's data as artifact after scripts are completed. Is there a way to do that without redirecting data folder to $CI_PROJECT_DIR?
What are the best practices of these two issues?
I created a Copy Data task in Azure Data Factory which will periodically copy modified files from my file system (self-hosted integration runtime) to an Azure Blob location. That works great when an existing file is modified or when a new file is created in the source, however, it won't delete a file from the blob destination when the corresponding file is deleted from the source file path location - since the file is gone, there is no modified date. Is there a way to keep the source and destination in sync via Azure Data Factory with individually deleted files such as in the scenario described above? Is there a better way to do this? Thanks.
I'm afraid to say Data Factory can't do that with actives, the pipeline only support read the exist file and copy them to sink. And sink side also doesn't support delete a file.
You can achieve that in code level, such as functions or notebook. After the copy finished, build a logic to compare the source and destination files list, delete the file which not exist in source list.
HTH.
I want to load the file contents from the gitlab api using a specific tag.
This can be achieved by using the blob for each file (https://docs.gitlab.com/ee/api/repository_files.html).
The problem I am facing is that I do not see the way to find out what file paths are available for a given commit (a tag in my case).
I am looking for something similar to github's tree object.
How do I get all the files and their respective paths with a given commit hash from the gitlab api to load their contents?
Thanks :)
You can get a list of repository files and directories in a project by calling this API:
GET /projects/:id/repository/tree
See here for more information such as optional parameters.
I created a (once run) DF (V2) pipeline to load files (.lta.gz) from a SFTP server into an azure blob to get historical data.
Worked beautifully.
Every day there will be several new files on the SFTP server (which cannot be manipulated or deleted). So I want to create an incremental load pipeline which checks daily for new files - if so ---> copy new files.
Does anyone have any tips for me how to achieve this?
Thanks for using Data Factory!
To incrementally load newly generated files on SFTP server, you can leverage the GetMetadata activity to retrieve the LastModifiedDate property:
https://learn.microsoft.com/en-us/azure/data-factory/control-flow-get-metadata-activity
Essentially you author a pipeline containing the following activities:
getMetadata (return list of files under a given folder)
ForEach (iterate through each file)
getMetadata (return lastModifiedTime for a given file)
IfCondition (compare lastModifiedTime with trigger WindowStartTime)
Copy (copy file from source to destination)
Have fun building data integration flows using Data Factory!
since I posted my previous answer in May last year, many of you contacted me asking for pipeline sample to achieve the incremental file copy scenario using the getMetadata-ForEach-getMetadata-If-Copy pattern. This has been important feedback that incremental file copy is a common scenario that we want to further optimize.
Today I would like to post an updated answer - we recently released a new feature that allows a much easier and scalability approach to achieve the same goal:
You can now set modifiedDatetimeStart and modifiedDatetimeEnd on SFTP dataset to specify the time range filters to only extract files that were created/modified during that period. This enables you to achieve the incremental file copy using a single activity:
https://learn.microsoft.com/en-us/azure/data-factory/connector-sftp#dataset-properties
This feature is enabled for these file-based connectors in ADF: AWS S3, Azure Blob Storage, FTP, SFTP, ADLS Gen1, ADLS Gen2, and on-prem file system. Support for HDFS is coming very soon.
Further, to make it even easier to author an incremental copy pipeline, we now release common pipeline patterns as solution templates. You can select one of the templates, fill out the linked service and dataset info, and click deploy – it is that simple!
https://learn.microsoft.com/en-us/azure/data-factory/solution-templates-introduction
You should be able to find the incremental file copy solution in the gallery:
https://learn.microsoft.com/en-us/azure/data-factory/solution-template-copy-new-files-lastmodifieddate
Once again, thank you for using ADF and happy coding data integration with ADF!