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

added ability to read missing values; test added #64

Merged
merged 2 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/reader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ function read_levels_and_values(io::IO, encs::Tuple, ctype::Int32, num_values::I

#@debug("before reading values bytesavailable in page: $(bytesavailable(io))")
# read values
vals = read_values(io, enc, ctype, num_values)
# if there are missing values in the data then
# where defn_levels's elements == 1 are present and only
# sum(defn_levels) values can be read.
# because defn_levels == 0 are where the missing vlaues are
nmissing = sum(==(0), defn_levels)
vals = read_values(io, enc, ctype, num_values - nmissing)

vals, defn_levels, repn_levels
end
Expand Down
Binary file added test/missingvalues/synthetic_data.parquet
Binary file not shown.
2 changes: 2 additions & 0 deletions test/test_decode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ function test_decode_all_pages()
end

test_decode_all_pages()

test_decode("synthetic_data.parquet", "missingvalues")