You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by ju...@apache.org on 2016/02/06 21:30:18 UTC
parquet-cpp git commit: PARQUET-455: Fix OS X / Clang compiler
warnings
Repository: parquet-cpp
Updated Branches:
refs/heads/master a5892f52f -> ecb6f60b0
PARQUET-455: Fix OS X / Clang compiler warnings
There actually was a legitimate bug fixed here for malformed Parquet files, but we are not yet in a position to write a decent test for it until PARQUET-497. I will make a note on that JIRA.
I also set our Travis CI build to fail on future compiler warnings.
This also closes #15.
Author: Wes McKinney <we...@cloudera.com>
Closes #40 from wesm/PARQUET-455 and squashes the following commits:
a348063 [Wes McKinney] Compiler warnings fail the build
271d71e [Wes McKinney] Fix OS X / Clang compiler warnings
Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/ecb6f60b
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/ecb6f60b
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/ecb6f60b
Branch: refs/heads/master
Commit: ecb6f60b06794d3ef251880708332ff7c8acace0
Parents: a5892f5
Author: Wes McKinney <we...@cloudera.com>
Authored: Sat Feb 6 12:30:14 2016 -0800
Committer: Julien Le Dem <ju...@dremio.com>
Committed: Sat Feb 6 12:30:14 2016 -0800
----------------------------------------------------------------------
.travis.yml | 2 +-
src/parquet/encodings/plain-encoding.h | 7 ++++++-
src/parquet/reader.cc | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ecb6f60b/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 0ac7c47..71a7767 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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:
http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ecb6f60b/src/parquet/encodings/plain-encoding.h
----------------------------------------------------------------------
diff --git a/src/parquet/encodings/plain-encoding.h b/src/parquet/encodings/plain-encoding.h
index 06d237a..03f5940 100644
--- a/src/parquet/encodings/plain-encoding.h
+++ b/src/parquet/encodings/plain-encoding.h
@@ -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);
http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ecb6f60b/src/parquet/reader.cc
----------------------------------------------------------------------
diff --git a/src/parquet/reader.cc b/src/parquet/reader.cc
index a90bafb..d3bc0a6 100644
--- a/src/parquet/reader.cc
+++ b/src/parquet/reader.cc
@@ -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) {
throw ParquetException("Invalid parquet file. File is less than file metadata size.");
}