Skip to content

Files without .parquet, .csv extension inferred as having no schema #1736

@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I wrote a test approximating

let file = tempfile::tempfile();

// ... write parquet data ...

let mut context = ExecutionContext::new();
context.register_parquet("t", file.path().as_str())
context.sql("select column from t");

This would result in "Invalid identifier" errors, effectively claiming the column didn't exist. I verified the file existed, had the correct columns, etc... I was very confused 😆

Eventually I tracked this down to the schema being inferred as empty if the extension is not ".parquet", this feels unexpected

Describe the solution you'd like

Either register_parquet should return an error if the extension is missing, or FileFormat::infer_schema should be more agnostic to file extensions.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions