Skip to content

Conversation

@xudong963
Copy link
Member

@xudong963 xudong963 commented Apr 10, 2025

Which issue does this PR close?

  • Closes #.

Rationale for this change

While upgrading DF46, I found tthat hese methods aren't public, but under some scenes, we may only need the projected schema or another, so it's not efficient to call project() method, which returns four elements

pub fn project(&self) -> (SchemaRef, Constraints, Statistics, Vec<LexOrdering>) {
        if self.projection.is_none() && self.table_partition_cols.is_empty() {
            return (
                Arc::clone(&self.file_schema),
                self.constraints.clone(),
                self.file_source.statistics().unwrap().clone(),
                self.output_ordering.clone(),
            );
        }

        let schema = self.projected_schema();
        let constraints = self.projected_constraints();
        let stats = self.projected_stats();

        let output_ordering = get_projected_output_ordering(self, &schema);

        (schema, constraints, stats, output_ordering)
    }

What changes are included in this PR?

Make the three projected methods public

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the datasource Changes to the datasource crate label Apr 10, 2025
@xudong963 xudong963 requested a review from alamb April 10, 2025 12:33
@alamb alamb merged commit 51cc046 into apache:main Apr 10, 2025
28 checks passed
@alamb
Copy link
Contributor

alamb commented Apr 10, 2025

Thanks @xudong963 and @jayzhan211

nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants