Skip to content

Commit a662563

Browse files
committed
apply suggestions
1 parent d32c40b commit a662563

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

cpp/src/parquet/arrow/arrow_parquet_index_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ using parquet::schema::GroupNode;
101101
using parquet::schema::NodePtr;
102102
using parquet::schema::PrimitiveNode;
103103

104-
namespace arrow::parquet {
104+
namespace parquet::arrow {
105105

106106
namespace {
107107

@@ -748,4 +748,4 @@ TEST_F(ParquetBloomFilterRoundTripTest, ThrowForBoolean) {
748748
::testing::HasSubstr("BloomFilterBuilder does not support boolean type"));
749749
}
750750

751-
} // namespace arrow::parquet
751+
} // namespace parquet::arrow

cpp/src/parquet/bloom_filter_builder_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace parquet {
2424

25-
/// @brief Interface for collecting bloom filter of a parquet file.
25+
/// @brief Interface for building bloom filters of a parquet file.
2626
class PARQUET_EXPORT BloomFilterBuilder {
2727
public:
2828
/// @brief API to create a BloomFilterBuilder.

cpp/src/parquet/bloom_filter_writer_internal.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ void BloomFilterWriterImpl<ParquetType>::UpdateBloomFilterSpaced(
100100
template <>
101101
void BloomFilterWriterImpl<BooleanType>::UpdateBloomFilterSpaced(const bool*, int64_t,
102102
const uint8_t*,
103-
int64_t) {}
103+
int64_t) {
104+
if (ARROW_PREDICT_FALSE(bloom_filter_ != nullptr)) {
105+
throw ParquetException("BooleanType does not support bloom filters");
106+
}
107+
}
104108

105109
template <>
106110
void BloomFilterWriterImpl<FLBAType>::UpdateBloomFilterSpaced(const FLBA* values,

cpp/src/parquet/bloom_filter_writer_internal.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
#pragma once
1919

2020
#include "parquet/bloom_filter.h"
21+
#include "parquet/type_fwd.h"
2122

2223
namespace arrow {
2324
class Array;
2425
}
2526

26-
namespace parquet {
27-
class ColumnDescriptor;
28-
}
29-
3027
namespace parquet::internal {
3128

3229
template <typename ParquetType>
@@ -41,6 +38,7 @@ class PARQUET_EXPORT BloomFilterWriterImpl {
4138
const uint8_t* valid_bits, int64_t valid_bits_offset);
4239
void UpdateBloomFilterArray(const ::arrow::Array& values);
4340

41+
/// @brief Check if this writer has enabled bloom filter.
4442
bool HasBloomFilter() const;
4543

4644
private:

cpp/src/parquet/properties.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ class PARQUET_EXPORT ColumnProperties {
242242

243243
void set_bloom_filter_options(std::optional<BloomFilterOptions> bloom_filter_options) {
244244
if (bloom_filter_options) {
245-
if (bloom_filter_options->fpp > 1.0 || bloom_filter_options->fpp < 0.0) {
245+
if (bloom_filter_options->fpp >= 1.0 || bloom_filter_options->fpp <= 0.0) {
246246
throw ParquetException(
247-
"Bloom filter false-positive probability must fall in [0.0, 1.0], got " +
247+
"Bloom filter false-positive probability must fall in (0.0, 1.0), got " +
248248
std::to_string(bloom_filter_options->fpp));
249249
}
250250
}
@@ -705,7 +705,7 @@ class PARQUET_EXPORT WriterProperties {
705705
/// Disable bloom filter for the column specified by `path`.
706706
/// Default disabled.
707707
Builder* disable_bloom_filter(const std::string& path) {
708-
bloom_filter_options_[path] = std::nullopt;
708+
bloom_filter_options_.erase(path);
709709
return this;
710710
}
711711

0 commit comments

Comments
 (0)