Skip to content

Conversation

@logan-keede
Copy link
Contributor

@logan-keede logan-keede commented Mar 19, 2025

Which issue does this PR close?

Rationale for this change

cte_worktable is a TableProvider.
default_table_source is a struct used to adapt TableProvider(physical trait) to logical trait.
Both seems to fit well in catalog crate.

What changes are included in this PR?

move cte_worktable and default_table_source (and perhaps a few more) out of core and a few more things to
move core/datasource/memory.rs(MemTable) to datasource crate

Are these changes tested?

testing by Github CI

Are there any user-facing changes?

Nope.

@github-actions github-actions bot added core Core DataFusion crate catalog Related to the catalog crate labels Mar 19, 2025
@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Mar 20, 2025
@logan-keede logan-keede marked this pull request as ready for review March 20, 2025 15:34
@alamb alamb changed the title refactor: moving a bunch of files out of core refactor: move CteWorkTable, default_table_source a bunch of files out of core Mar 20, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @logan-keede -- this looks good to me too

use std::any::Any;
use std::sync::Arc;

/// Simple in-memory implementation of a schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nice to break this out into a new module

}

/// Create a physical sort expression from a logical expression
pub fn create_physical_sort_expr(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense to move into physical expr too

@logan-keede
Copy link
Contributor Author

where does Memtable belong datasource or catalog? it is TableProvider implementation so I thought It was going to be in catalog, but I m not so sure anymore as it has dependency on datasource.

@alamb
Copy link
Contributor

alamb commented Mar 20, 2025

where does Memtable belong datasource or catalog? it is TableProvider implementation so I thought It was going to be in catalog, but I m not so sure anymore as it has dependency on datasource.

I think MemTable beloings in datasource (as it is a table provider)

Since it is so simple / has very few dependencies I think it could also be in catalog so we have a simple implementation of an in memory system without needing stuff in datasource. However, I am not sure it really matters

@logan-keede
Copy link
Contributor Author

logan-keede commented Mar 20, 2025

I thought it mattered because datasource has a dependency on catalog but on a second look it is only Session. Any plans on moving Session to execution ?
also corresponding Schema and Catalog providers are in catalog, some other tableProvider implementation are also in catalog, so having in-memory format's TableProvider in datasource was not intuitive for me.

@alamb
Copy link
Contributor

alamb commented Mar 21, 2025

I thought it mattered because datasource has a dependency on catalog but on a second look it is only Session. Any plans on moving Session to execution ?

I don't know of any

also corresponding Schema and Catalog providers are in catalog, some other tableProvider implementation are also in catalog, so having in-memory format's TableProvider in datasource was not intuitive for me.

So are you happy with this PR as is now? Does it make more sense?

@logan-keede
Copy link
Contributor Author

So are you happy with this PR as is now? Does it make more sense?

Yes, but I think we should consider moving In-memory format's providers from catalog to datasource and Session to execution, if that makes sense to you then I can either do it in this PR or a follow up PR.

@alamb alamb merged commit 6859b93 into apache:main Mar 21, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

catalog Related to the catalog crate core Core DataFusion crate physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants