Skip to content

adding some bad parquet files - #58

Merged
mapleFU merged 4 commits into
apache:masterfrom
jp0317:bad
Aug 15, 2024
Merged

mapleFU merged 4 commits into
apache:masterfrom
jp0317:bad

Conversation

@jp0317

@jp0317 jp0317 commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

Hi, these two bad files can help reproduce the two examples mentioned in apache/arrow-rs#6228.

@mapleFU

mapleFU commented Aug 14, 2024 •

Copy link
Copy Markdown
Member

Just wonder how these file is generated? 🤔 These files are little, which is good for our testing

@mapleFU

mapleFU commented Aug 15, 2024

Copy link
Copy Markdown
Member

@jp0317 I've check the bad-dict file, it throw here in C++ code:

  if (col_start < 0 || col_length < 0) {
    throw ParquetException("Invalid column metadata (corrupt file?)");
  }

  if (AddWithOverflow(col_start, col_length, &col_end) || col_end > source_size) {
    throw ParquetException("Invalid column metadata (corrupt file?)");
  }

So maybe arrow-rs can also check this? ( also cc @alamb )

@mapleFU

mapleFU commented Aug 15, 2024 •

Copy link
Copy Markdown
Member

@pitrou Would you mind check the naming of the 2 new bad file here?

Besides, the bad-levels file is similiar to existing bad level file, but I think one more bad file is ok. Want to hear what do you think of this

@alamb

alamb commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

So maybe arrow-rs can also check this? ( also cc @alamb )

I agree we should add tests to parquet-rs to test these bad files. I'll see what i can do

@alamb

alamb commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

So maybe arrow-rs can also check this? ( also cc @alamb )

I made a PR to check these files with Rust: apache/arrow-rs#6262

@jp0317

jp0317 commented Aug 16, 2024 •

Copy link
Copy Markdown
Contributor Author

@jp0317 I've check the bad-dict file, it throw here in C++ code:

  if (col_start < 0 || col_length < 0) {
    throw ParquetException("Invalid column metadata (corrupt file?)");
  }

  if (AddWithOverflow(col_start, col_length, &col_end) || col_end > source_size) {
    throw ParquetException("Invalid column metadata (corrupt file?)");
  }

So maybe arrow-rs can also check this? ( also cc @alamb )

looks like the col start and length are checked against negative here but isn't checked against the file length.

Beside, it seems we'd better check data_len against file length instead of "with_capacity() then take() here

@mapleFU

mapleFU commented Aug 16, 2024

Copy link
Copy Markdown
Member

I've an issue here: apache/arrow-rs#6255 , glad to learn some rust code lol

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.

4 participants