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

Returns error too late when parsing invalid file compression type. #4636

Closed
HaoYang670 opened this issue Dec 15, 2022 · 0 comments · Fixed by #4637
Closed

Returns error too late when parsing invalid file compression type. #4636

HaoYang670 opened this issue Dec 15, 2022 · 0 comments · Fixed by #4637
Assignees
Labels
enhancement New feature or request

Comments

@HaoYang670
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
When parsing a SQL query with an invalid file compression type, we detect the error when creating the ListingTable which is too late:

❯ create external table t1 stored as csv with header row compression type zzz location "../datafusion/core/tests/example.csv";
Execution("Unknown FileCompressionType ZZZ")

Besides, we should return a ParserError, instead of a DataFusionError::Execution error.
https://github.com/apache/arrow-datafusion/blob/3611d911a3c9f3740bb1fc0527198be39ff47bfd/datafusion/core/src/datasource/listing_table_factory.rs#L62-L70

Describe the solution you'd like
We could detect this error when parsing the CreateExternalTable

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
We could not do this.

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

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