Hi Aldo, hi Yuseok, Thanks to both of you, and welcome on board. Between the two replies the phase 1 team is there: Aldo on the prefix copy and the shared behaviour suite, Yuseok on the folder-marker rule, on reporting what was copied (the return values you did under #11323) and on the twelve operators that need work before they fit. I have put both of you and your findings on the AIP page.
Aldo, your remark about the pods is the heart of the AIP, so let me confirm it in plain words: the logic lives in the hooks, or in common helpers they share, never in the operator. The operator is a facilitator in Dags for the standard case: it resolves the two hooks, forwards each side's arguments, drives the loop and emits lineage. This is not specific to transfers. It is the design principle Airflow has always had for operators and hooks, an operator holds no logic of its own and delegates to the underlying hook, and the 86 transfer modules are the clearest case where it was not respected. The AIP states it as a general architecture principle and applies it to this topic. Streaming is part of that rule. Bytes and record batches flow through the hook and the path layer in chunks, so peak memory follows the batch, not the dataset, and that holds for every operator, @task function or trigger that uses the same hook, not for one operator that happens to stream. This is now a design principle on the page and a review criterion for every PR under it; your numbers (95 MB vs 344 MB for 1M rows; 14 s at 1.35 GiB vs 5.3 s at 234 MiB) are in it as evidence. Your prototype is close to that already, with one step left. The listing, the marker classification and the copy plan are module-level helpers today, and a subclass of FileTransferOperator calls them. In the AIP they belong one level down: on ObjectStoragePath, or in common.io helpers the path uses, so that FileTransferOperator itself grows the prefix copy and no subclass remains. The cross-store stream is already there: ObjectStoragePath._cp_file is shutil.copyfileobj between the two opened files, and same-store copy goes through fs.copy as you do. So most of the phase 1 work is moving your functions to where every caller finds them. On your three points: markers classified from the one listing, agreed; native fast path same-store first and then an optional "I can do this natively" on the hook, agreed; pages as Arrow batches for tabular sources and dicts for REST, sized by the source, agreed, we measured the same on DuckDB and ADBC (executemany on rows against a from_arrow insert is minutes against a fraction of a second for 1M rows). Your 34-of-35 run with #76880 as the one miss is the best argument we have for the behaviour suite: it finds bugs in the existing operators too. Yuseok, your split of the 28 is exactly the readiness table the phase needed, and I have checked it against main: five filesystems are registered today (s3, gcs, adls, sftp, plus local from fsspec itself), ADLSToGCSOperator and LocalFilesystemToADLSOperator still go through the Gen1 AzureDataLakeHook, and Glacier and IMAP are indeed not file copies. So phase 1 becomes: the 16 that are ready, then the 12 in the order you propose: FTP and SMB: register the fsspec implementations that exist (a filesystems: entry in provider.yaml plus the fs module, as sftp did). Small, and good first PRs. ADLS: the two Gen1 operators move to Gen2 and abfs in the same step; Gen1 itself is retired by Microsoft. Google Drive: ID-based, with only a third-party fsspec implementation. I would keep the four Drive operators as wrappers over a Drive hook capability and not force a path abstraction on them; to be decided on the page. Azure File Share: no fsspec implementation yet, so it waits for one or stays a wrapper. Glacier and IMAP: out of phase 1. Glacier is a retrieval job, IMAP attachments are a records source (one record per attachment), so they go to phases 3 and 2 respectively. Yes, please take the twelve, and the folder-marker rule and the return values with them. Could you both put your remaining open items as comments on the AIP page, so they are in one place with Amogh's? I have linked the demo PR, the bench repository and the readiness table from the page. Kind regards, David On 2026/11/25 16:43:11 Yuseok Jo wrote: > Hi David, Amogh, > > Thank you both for turning the thread into AIP-132. I'm really glad to see > this moving forward. > > I think I could help with the folder-marker rule, since I worked on those > fixes, or with reporting what was copied, since I worked on the return > values of several transfer operators under #11323. That said, I'd like to > contribute wherever it's needed. > > While looking into this, I also went through the 28 file-to-file operators > in phase 1. 16 of them already have a filesystem in Airflow at both ends > (S3, GCS, Azure Blob, SFTP, local), so they only need the phase 1 operator. > The other 12 need more investigation and some changes first: > > - ADLS (ADLSToGCSOperator, LocalFilesystemToADLSOperator): they still > read or write through the Gen1 hook, so moving them to abfs also means > moving them to Gen2. (ADLSToGCSOperator already lists through Gen2.) > - FTP (FTPToS3Operator, S3ToFTPOperator) and SMB (GCSToSambaOperator): > the filesystem needs to be registered in Airflow. fsspec already has > implementations. > - Google Drive (GCSToGoogleDriveOperator, GoogleDriveToGCSOperator, > GoogleDriveToLocalOperator, LocalFilesystemToGoogleDriveOperator): only a > third-party fsspec implementation exists, and Drive is ID-based rather than > path-based. > - Azure File Share (AzureFileShareToGCSOperator): there is no fsspec > implementation yet. > - Glacier (GlacierToGCSOperator) and IMAP (ImapAttachmentToS3Operator): > they aren't file copies (a vault inventory retrieval and mail attachments), > so they may not belong in phase 1. > > I'm also happy to look into these 12 if that helps. > > Best, > Yuseok > > On Thu, Nov 26, 2026 at 12:52 AM Aldo Escobar <[email protected]> wrote: > > > Hi David, > > > > Thanks for writing up AIP-132, it reads really well. +1, and I'd be glad to > > co-author it, mainly on phase 1 and the shared behaviour suite (my earlier > > reply ended up in a separate thread, sorry about that). > > > > Since Amogh's point was that FileTransferOperator only copies one object, I > > gave phase 1 a try on the real APIs. It's a small subclass of common.io > > FileTransferOperator on ObjectStoragePath (Airflow 3.4) that copies a whole > > prefix: it lists once, skips folder markers from that same listing, can > > skip existing keys, and returns the copied keys. Within one store it uses > > ObjectStoragePath.copy, across stores it streams in chunks, and a single > > file behaves exactly as today. It passes on local and S3/GCS/Azure > > emulators; deferrable mode, OpenLineage and real cloud accounts are still > > to do. Code and a short write-up against the AIP's open items: > > https://github.com/aoelvp94/airflow-generic-transfer-contract-demo/pull/12 > > > > A few thoughts on the open questions, happy to be argued out of any of > > them: > > - Folder markers: classify them from the one listing, so no backend needs > > an extra call per key. > > - Native fast path: start with same-store copy, then let a hook optionally > > say "I can do this natively". > > - Pages: Arrow batches for tabular sources, dicts for REST, sized by the > > source, so memory follows the batch rather than the dataset. > > > > On that last one, two data points (one machine, small n): > > - Streaming Arrow batches end to end keeps peak memory at ~95 MB for 1M > > rows, vs ~344 MB when converting to rows first, and it stays flat at 4x the > > rows. > > - Postgres -> S3, 1M rows: SqlToS3Operator took 14 s and peaked at ~1.35 > > GiB; a streaming @task did it in 5.3 s at ~234 MiB, same output ( > > https://github.com/aoelvp94/airflow-transfer-bench). > > > > Not a knock on the operator, it has to cover every case. But I've run > > transfers in pods, where peak memory decides the pod size, so having the > > streaming in the hook once instead of in each operator matters a lot to me. > > > > On the regression concern: in an earlier prototype, one generic operator > > matched the existing ones on 34 of 35 checks across the 9 S3/GCS/Azure > > pairs, and the one miss was a real bug in S3ToAzureBlobStorageOperator ( > > https://github.com/apache/airflow/issues/76880, fix in > > https://github.com/apache/airflow/pull/76971). So I see a shared behaviour > > suite as the safety net, and I'm happy to start it. > > > > Thanks, > > Aldo > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
