Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaner code for Read Options in reader methdos. #5024

Closed
saikrishna1-bidgely opened this issue Jan 22, 2023 · 0 comments · Fixed by #5025
Closed

Cleaner code for Read Options in reader methdos. #5024

saikrishna1-bidgely opened this issue Jan 22, 2023 · 0 comments · Fixed by #5025
Labels
enhancement New feature or request

Comments

@saikrishna1-bidgely
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
This will make the code a bit cleaner and help with simpler code in #4908.

Describe the solution you'd like
We want to implement a trait ReadOptions which will implemented for CsvReadOptions and other similar structs. The trait will be as follows:

pub trait ReadOptions<'a> {
    /// Helper to convert these user facing options to `ListingTable` options
    fn to_listing_options(&self, target_partitions: usize) -> ListingOptions;
    ///
    async fn get_resolved_schema(
        &self,
        target_partitions: usize,
        state: SessionState,
        table_path: ListingTableUrl,
    ) -> Result<SchemaRef>;
}

Describe alternatives you've considered
Nothing here.

Additional context
This will help with simpler code in #4908.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant