anuragmantri commented on PR #55: URL: https://github.com/apache/datafusion-iceberg/pull/55#issuecomment-7142098182
I'm revisiting this PR. Since it's been a while, there are some changes. #113 added `FileScanTaskProvider`, so a scan can now have many partitions. It also added eager planning, so listing files before execution is now a separate opt-in mode. #87 and #88 added test tools and a generated Taxi table. I propose a new design: The scan no longer merges anything. With eager planning and at most `target_partitions files`, each partition already reads exactly one file. If every file records the same sort order, the eager provider reports that order for each partition. DataFusion then adds a `SortPreservingMergeExec` only where a parent needs the order, and a `CoalescePartitionsExec` otherwise. DataFusion's `FileScanConfig` reports file ordering the same way. With more files than target_partitions, or files whose orders differ, the scan reads unordered, as it does today. The order lives on the provider through a new default trait method, `FileScanTaskProvider::output_ordering`, so a rebuilt or serialized scan keeps it. Because the order comes from reading one file per partition. Engines that plan their own `FileScanTasks` can set it with `EagerFileScanTaskProvider::with_sort_order`. The ordering rules reviewed in this don't change. Before this, I want to split the PR as suggested here: 1. Test tooling to write sorted files. New sqllogictests that record plans for ORDER BY, LIMIT, GROUP BY and a sort-merge join. No library changes in this PR 2. The `iceberg.execution.preserve_data_ordering` option, which turns on eager planning, plus the provider and source changes above. The plans recorded in step 1 change in this PR, so the diff shows exactly what the feature does. I will move this PR to a draft and start working on 1) above. Thanks folks for your patience and guidance. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
