Conversation
Add `skipinitialspace=True` to csv reader. This works around CSV files that use
leading spaces in headers/fields and makes inference more tolerant (" 2" gets
inferred as a number instead of a string).
col1,col2,col3
1, 2, aa
Only treat actual JSON objects as the JSON datatype (had some false positives
where `"42"` parses as JSON by us but it really shouldn't be.
Ignore empty rows at inference/query time.
This is a tradeoff, since it means we will try to silently ignore errors in malformed/weird CSV files and return a bunch of varchar columns because some data is shifted around, however, this is still better than flat out erroring since it will give the user some feedback and let them change the parameters or know how to fix their file.
mildbyte
added a commit
that referenced
this pull request
Nov 17, 2021
* Splitfile speedups (#567) * Various query speedups (#563, #561) * More robust CSV querying (#562) Full set of changes: [`v0.2.17...v0.2.18`](v0.2.17...v0.2.18)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make CSV parsing/inference more robust so that it doesn't crash on examples from (https://people.sc.fsu.edu/~jburkardt/data/csv/csv.html) (sometimes they are malformed, but it will output a table with paddings/truncations).