Skip to content

Ensure schema-less tables have all rows respected in load! #260

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

Merged
merged 1 commit into from
Oct 20, 2021
Merged

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 20, 2021

Fixes #259. This one feels bad. For the schema-less input table case, we
iterated the first row to get the names so we could do some schema
validation, but then threw the row away, assuming that as we iterate
later, we would somehow get all the rows anyway. That probably was fine
in cases like a DataFrame, where iteration would correctly restart, but
for most schema-less tables, it's not uncommon to be a stateful iterator
that is forward-pass only (like SQLite.Query!). We fix this here by
ensuring that row stays intact and is inserted before iterating further
rows.

Fixes #259. This one feels bad. For the schema-less input table case, we
iterated the first row to get the names so we could do some schema
validation, but then threw the row away, assuming that as we iterate
later, we would somehow get all the rows anyway. That probably was fine
in cases like a DataFrame, where iteration would correctly restart, but
for most schema-less tables, it's not uncommon to be a stateful iterator
that is forward-pass only (like `SQLite.Query`!). We fix this here by
ensuring that row stays intact and is inserted before iterating further
rows.
@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #260 (9d52d28) into master (03b526e) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   84.53%   84.71%   +0.18%     
==========================================
  Files           5        5              
  Lines         666      674       +8     
==========================================
+ Hits          563      571       +8     
  Misses        103      103              
Impacted Files Coverage Δ
src/tables.jl 99.25% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03b526e...9d52d28. Read the comment docs.

@quinnj quinnj merged commit 82e1add into master Oct 20, 2021
@quinnj quinnj deleted the jq/259 branch October 20, 2021 04:56
@geoffleyland
Copy link

Wow! Thanks for the quick response on this one!

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.

SQLite 1.2.0's load! eats the first row of rows in the unknown schema case
2 participants