Skip to content

Commit 4bcfb0e

Browse files
wesmjulienledem
authored andcommitted
PARQUET-519: Remove last of suppressed compiler warnings
Author: Wes McKinney <wesm@apache.org> Closes apache#69 from wesm/PARQUET-519 and squashes the following commits: cde787e [Wes McKinney] Initialize RleDecoder with encoded_len b8f0234 [Wes McKinney] Remove -Wno-unused-variable and fix compiler warnings Change-Id: I348d009c9ad415f248b0d53d86a652bbd9f524b5
1 parent 853b128 commit 4bcfb0e

9 files changed

Lines changed: 5 additions & 16 deletions

File tree

cpp/src/parquet/column/levels-test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ namespace parquet_cpp {
3030

3131
void GenerateLevels(int min_repeat_factor, int max_repeat_factor,
3232
int max_level, std::vector<int16_t>& input_levels) {
33-
int total_count = 0;
3433
// for each repetition count upto max_repeat_factor
3534
for (int repeat = min_repeat_factor; repeat <= max_repeat_factor; repeat++) {
3635
// repeat count increases by a factor of 2 for every iteration

cpp/src/parquet/column/levels.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class LevelDecoder {
104104
int SetData(Encoding::type encoding, int16_t max_level,
105105
int num_buffered_values, const uint8_t* data) {
106106
uint32_t num_bytes = 0;
107-
uint32_t total_bytes = 0;
108107
encoding_ = encoding;
109108
num_values_remaining_ = num_buffered_values;
110109
bit_width_ = BitUtil::Log2(max_level + 1);

cpp/src/parquet/column/test-util.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ class DataPageBuilder {
102102
if (encoding != Encoding::PLAIN) {
103103
ParquetException::NYI("only plain encoding currently implemented");
104104
}
105-
int bytes_to_encode = values.size() * sizeof(T);
106-
107105
PlainEncoder<TYPE> encoder(d);
108106
encoder.Encode(&values[0], values.size(), sink_);
109107

@@ -171,8 +169,6 @@ void DataPageBuilder<Type::BOOLEAN>::AppendValues(const ColumnDescriptor *d,
171169
if (encoding != Encoding::PLAIN) {
172170
ParquetException::NYI("only plain encoding currently implemented");
173171
}
174-
int bytes_to_encode = values.size() * sizeof(bool);
175-
176172
PlainEncoder<Type::BOOLEAN> encoder(d);
177173
encoder.Encode(values, values.size(), sink_);
178174

@@ -186,8 +182,6 @@ static std::shared_ptr<DataPage> MakeDataPage(const ColumnDescriptor *d,
186182
const std::vector<T>& values,
187183
const std::vector<int16_t>& def_levels, int16_t max_def_level,
188184
const std::vector<int16_t>& rep_levels, int16_t max_rep_level) {
189-
int num_values = values.size();
190-
191185
InMemoryOutputStream page_stream;
192186
test::DataPageBuilder<TYPE> page_builder(&page_stream);
193187

cpp/src/parquet/encodings/dictionary-encoding.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ inline void DictEncoder<T>::Put(const T& v) {
314314
index = hash_slots_[j];
315315
}
316316

317-
int bytes_added = 0;
318317
if (index == HASH_SLOT_EMPTY) {
319318
// Not in the hash table, so we insert it now
320319
index = uniques_.size();

cpp/src/parquet/encodings/encoding-test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ template <>
9696
void GenerateData<ByteArray>(int num_values, ByteArray* out, vector<uint8_t>* heap) {
9797
// seed the prng so failure is deterministic
9898
int max_byte_array_len = 12;
99-
int num_bytes = max_byte_array_len + sizeof(uint32_t);
10099
heap->resize(num_values * max_byte_array_len);
101100
random_byte_array(num_values, 0, heap->data(), out, 2, max_byte_array_len);
102101
}

cpp/src/parquet/file/file-deserialize-test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class TestPageSerde : public ::testing::Test {
7777
// have meaningful data associated with them
7878

7979
// Serialize the Page header
80-
uint32_t serialized_len = max_serialized_len;
8180
page_header_.__set_data_page_header(data_page_header_);
8281
page_header_.uncompressed_page_size = uncompressed_size;
8382
page_header_.compressed_page_size = compressed_size;

cpp/src/parquet/file/reader.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ void ParquetFileReader::DebugPrint(std::ostream& stream, bool print_values) {
170170
vector<std::shared_ptr<Scanner> > scanners(num_columns, NULL);
171171
for (int i = 0; i < num_columns; ++i) {
172172
std::shared_ptr<ColumnReader> col_reader = group_reader->Column(i);
173-
Type::type col_type = col_reader->type();
174173

175174
std::stringstream ss;
176175
ss << "%-" << COL_WIDTH << "s";

cpp/src/parquet/thrift/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ set(THRIFT_SRCS
1919
parquet_constants.cpp
2020
parquet_types.cpp)
2121

22+
set_source_files_properties(parquet_types.cpp PROPERTIES
23+
COMPILE_FLAGS -Wno-unused-variable)
24+
2225
add_library(parquet_thrift STATIC
2326
${THRIFT_SRCS}
2427
)

cpp/src/parquet/util/rle-test.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,9 @@ bool CheckRoundTrip(const vector<int>& values, int bit_width) {
221221
int encoded_len = encoder.Flush();
222222
int out;
223223

224-
RleDecoder decoder(buffer, len, bit_width);
224+
RleDecoder decoder(buffer, encoded_len, bit_width);
225225
for (size_t i = 0; i < values.size(); ++i) {
226-
uint64_t val;
227-
bool result = decoder.Get(&out);
226+
EXPECT_TRUE(decoder.Get(&out));
228227
if (values[i] != out) {
229228
return false;
230229
}
@@ -354,7 +353,6 @@ TEST(BitRle, Random) {
354353
std::random_device rd;
355354
std::uniform_int_distribution<int> dist(1, 20);
356355

357-
uint32_t seed = 0;
358356
for (int iter = 0; iter < niters; ++iter) {
359357
// generate a seed with device entropy
360358
uint32_t seed = rd();

0 commit comments

Comments
 (0)