You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "blaginin (via GitHub)" <gi...@apache.org> on 2025/03/01 10:46:44 UTC

[PR] Do not swap with projection when file is partitioned [datafusion]

blaginin opened a new pull request, #14956:
URL: https://github.com/apache/datafusion/pull/14956

   ## Which issue does this PR close?
   
   Related to https://github.com/delta-io/delta-rs/pull/3261#issuecomment-2691373678
   
   
   
   ## Rationale for this change 
   
   I feel like there should be a way to apply swapping even if the file is partitioned - but submitting a hotfix since it's a release blocker
   
   ## What changes are included in this PR?
   
   
   ## Are these changes tested?
   
   
   ## Are there any user-facing changes?
   
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Do not swap with projection when file is partitioned [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #14956:
URL: https://github.com/apache/datafusion/pull/14956#issuecomment-2692725460

   I made a small follow on: 
   - https://github.com/apache/datafusion/pull/14963


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Do not swap with projection when file is partitioned [datafusion]

Posted by "blaginin (via GitHub)" <gi...@apache.org>.
blaginin commented on PR #14956:
URL: https://github.com/apache/datafusion/pull/14956#issuecomment-2692137880

   ```
   uv run pytest 
   ================================================== 472 passed, 4 skipped, 47 deselected, 90 warnings in 23.16s ===================================================
   ```


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Do not swap with projection when file is partitioned [datafusion]

Posted by "blaginin (via GitHub)" <gi...@apache.org>.
blaginin commented on code in PR #14956:
URL: https://github.com/apache/datafusion/pull/14956#discussion_r1976506356


##########
datafusion/datasource/src/file_scan_config.rs:
##########
@@ -266,7 +266,10 @@ impl DataSource for FileScanConfig {
     ) -> Result<Option<Arc<dyn ExecutionPlan>>> {
         // If there is any non-column or alias-carrier expression, Projection should not be removed.
         // This process can be moved into CsvExec, but it would be an overlap of their responsibility.
-        Ok(all_alias_free_columns(projection.expr()).then(|| {
+
+        Ok((all_alias_free_columns(projection.expr())
+            && self.table_partition_cols.is_empty())

Review Comment:
   great point 🤗



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Do not swap with projection when file is partitioned [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #14956:
URL: https://github.com/apache/datafusion/pull/14956


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Do not swap with projection when file is partitioned [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #14956:
URL: https://github.com/apache/datafusion/pull/14956#discussion_r1976407254


##########
datafusion/datasource/src/file_scan_config.rs:
##########
@@ -266,7 +266,10 @@ impl DataSource for FileScanConfig {
     ) -> Result<Option<Arc<dyn ExecutionPlan>>> {
         // If there is any non-column or alias-carrier expression, Projection should not be removed.
         // This process can be moved into CsvExec, but it would be an overlap of their responsibility.
-        Ok(all_alias_free_columns(projection.expr()).then(|| {
+
+        Ok((all_alias_free_columns(projection.expr())
+            && self.table_partition_cols.is_empty())

Review Comment:
   It seems like the check might be if any of the columns needed are in the table_partition_cols (rather than there just being partition columns at all) 🤔  Or something like that
   
   



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org