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

fix: bson type handling cleanup #2313

Merged
merged 5 commits into from
Dec 27, 2023
Merged

Conversation

tychoish
Copy link
Contributor

No description provided.

@tychoish
Copy link
Contributor Author

I expect the mongodb tests might fail, because I removed an "empty-string-to-null" converter in the schema inference and an incompatibility between the CSV inference (empty cells are empty strings) and our assumption (here) that "empty cells are nulls". I think empty cells should probably be nulls, but this seems tractable to fix (potentially in testing).

@tychoish tychoish requested a review from scsmithr December 27, 2023 16:27
@scsmithr
Copy link
Member

For reference, our current csv inference will put nulls for empty strings

> select * from 'test.csv';                                                                          
┌───────┬───────┬───────┐
│     a │     b │     c │
│    ── │    ── │    ── │
│ Int64 │ Int64 │ Int64 │
╞═══════╪═══════╪═══════╡
│     1 │     2 │     3 │
│  NULL │     4 │     5 │
│     6 │  NULL │     7 │
│     8 │     9 │  NULL │
└───────┴───────┴───────┘

test.csv:

a,b,c
1,2,3
,4,5
6,,7
8,9,

@tychoish
Copy link
Contributor Author

I realized that the bug wasn't our csv handling but the way that the test fixture used mongoimport and so by adding a new option there I was able to remove the work around.

@tychoish tychoish merged commit 6835680 into main Dec 27, 2023
13 checks passed
@tychoish tychoish deleted the tycho/bson-type-handling-cleanup branch December 27, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants