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 quoted non-string fields in the CSV parser #1858

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

dominiklohmann
Copy link
Member

@dominiklohmann dominiklohmann commented Aug 20, 2021

📔 Description

Before this change, only the field parser which we used for column names and string fields respected possible quoting and escaping of fields. Now, all non-container types support quoting.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

Read the code. The tests should be self explanatory. The changed tests failed before the parser changes.

@dominiklohmann dominiklohmann added the bug Incorrect behavior label Aug 20, 2021
@dominiklohmann dominiklohmann requested review from mavam and a team August 20, 2021 08:54
Before this change, only the `field` parser which we used for column
names and string fields respected possible quoting and escaping of
fields. Now, all non-container types support quoting.
Copy link
Member

@lava lava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and even comes with unit tests!

It would be interesting to have a before/after comparsion of CSV import speed, since there is now an additional branch for every value.

@dominiklohmann
Copy link
Member Author

It would be interesting to have a before/after comparsion of CSV import speed, since there is now an additional branch for every value.

I doubt it'll be too much, there are already many branches in the parser and this will mostly be just a check for a double quote that returns false so we go back to the previous behavior. And considering this is a bug fix I don't really see how we can improve upon this, sadly.

@dominiklohmann dominiklohmann merged commit 5851dc1 into master Aug 20, 2021
@dominiklohmann dominiklohmann deleted the topic/csv-escaping branch August 20, 2021 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants