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

Support for custom ParquetFileReaderFactory #186

Open
thinkharderdev opened this issue Sep 4, 2022 · 2 comments
Open

Support for custom ParquetFileReaderFactory #186

thinkharderdev opened this issue Sep 4, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@thinkharderdev
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

DataFusion recently added a way to provide a user-defined AsyncFileReader to ParquetExec. Currently there is no way to leverage this in Ballista since the deserialization logic will construct a ParquetExec with the default implementation (which essentially just uses the registered ObjectStore).

Describe the solution you'd like
A clear and concise description of what you want to happen.

We should be able to leverage this feature in Ballista without overriding the entire serialization logic for physical plans.

I see one of two approaches here:

  1. Push this back into DataFusion and allow registration of custom ParquetFileReaderFactory in the SessionContext somewhere in which case it should be trivial to support in Ballista.
  2. Add this capability in ballista explicitly.

For option 2, we might consider using the PhysicalExtensionCodec for this. We could add methods:

    /// The deserialization logic will invoke this method for any `PhysicalPlanType::ParquetScan` nodes in the serialized plan. If a custom deserialization is required, apply it and return the deserialized result, otherwise return None and the deserialization will fallback to the default
    fn try_decode_parquet_exec(
        &self,
        scan: &ParquetScanExecNode,
    ) -> Result<Option<ParquetExec>, BallistaError> {
        Ok(None)
    }

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@thinkharderdev thinkharderdev added the enhancement New feature or request label Sep 4, 2022
@avantgardnerio
Copy link
Contributor

@thinkharderdev this seems related: apache/datafusion#3311

@thinkharderdev
Copy link
Contributor Author

@thinkharderdev this seems related: apache/arrow-datafusion#3311

Thanks! I think that could potentially support this use case. Either TableProviderFactory or TableProvider would need to expose a way to get an AyncFileReader.

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

No branches or pull requests

2 participants