Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ before_install:

before_script:
- source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh
- cmake $TRAVIS_BUILD_DIR
- cmake -DCMAKE_CXX_FLAGS="-Werror" $TRAVIS_BUILD_DIR
- export PARQUET_TEST_DATA=$TRAVIS_BUILD_DIR/data

script:
Expand Down
7 changes: 6 additions & 1 deletion src/parquet/encodings/plain-encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ class PlainEncoder<Type::BOOLEAN> : public Encoder<Type::BOOLEAN> {
explicit PlainEncoder(const ColumnDescriptor* descr) :
Encoder<Type::BOOLEAN>(descr, parquet::Encoding::PLAIN) {}

virtual size_t Encode(const std::vector<bool>& src, int num_values,
virtual size_t Encode(const bool* src, int num_values, uint8_t* dst) {
throw ParquetException("this API for encoding bools not implemented");
return 0;
}

size_t Encode(const std::vector<bool>& src, int num_values,
uint8_t* dst) {
size_t bytes_required = BitUtil::RoundUp(num_values, 8) / 8;
BitWriter bit_writer(dst, bytes_required);
Expand Down
2 changes: 1 addition & 1 deletion src/parquet/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void ParquetFileReader::ParseMetaData() {

uint32_t metadata_len = *reinterpret_cast<uint32_t*>(footer_buffer);
size_t metadata_start = filesize - FOOTER_SIZE - metadata_len;
if (metadata_start < 0) {
if (FOOTER_SIZE + metadata_len > filesize) {
Copy link
Member

Choose a reason for hiding this comment

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

metadata_start < 0
<=> filesize - FOOTER_SIZE - metadata_len < 0
<=> filesize < FOOTER_SIZE + metadata_len
<=> FOOTER_SIZE + metadata_len > filesize
right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep

throw ParquetException("Invalid parquet file. File is less than file metadata size.");
}

Expand Down