Skip to content

Support COPY TO Externally Defined File Formats, add FileType trait#11060

Merged
alamb merged 23 commits intoapache:mainfrom
devinjdangelo:external_file_types
Jun 28, 2024
Merged

Support COPY TO Externally Defined File Formats, add FileType trait#11060
alamb merged 23 commits intoapache:mainfrom
devinjdangelo:external_file_types

Conversation

@devinjdangelo
Copy link
Contributor

@devinjdangelo devinjdangelo commented Jun 22, 2024

Which issue does this PR close?

Closes #8345
Revives #8667

Rationale for this change

Previously, COPY TO queries could only be planned/executed for a preset enum of FileTypes. CREATE EXTERNAL TABLE supports arbitrary file formats via the FileFormat and TableProvider traits. This PR removes the FileType enum in favor of a FileType trait and updates COPY TO plans to work with any externally implemented dyn FileFormat.

This PR also enables future work to remove csv, parquet, json, ect... formats into dedicated crates (datafusion-csv, ...).

What changes are included in this PR?

  • Deletes the FileType enum and replaces with a trait
  • Creates a wrapper struct for FileFormat that implements FileType to enable conversions between the two
  • Extends LogicalExtensionCodec to allow serde of dyn FileType

Are these changes tested?

Existing tests verify behavior for currently supported formats remains the same.

Are there any user-facing changes?

Yes, there are API changes relevant for developers using DataFusion.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate logical-expr Logical plan and expressions sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enable users to add support for LIstingTable / object_store table formats of different types

4 participants