Skip to content

Commit fbdba4f

Browse files
Artem Tarasovwesm
authored andcommitted
PARQUET-779: Export TypedRowGroupStatistics in libparquet
Workaround is necessary because of GCC bug 40068/50044. `-Wattributes` diagnostic is temporarily disabled, as it seems the easiest solution. Author: Artem Tarasov <artem.tarasov@embl.de> Closes apache#193 from lomereiter/PARQUET-779 and squashes the following commits: 66a17fa [Artem Tarasov] proper gcc compiler detection 835e913 [Artem Tarasov] Expose TypedRowGroupStatistics in libparquet.so Change-Id: I5db5f94fb99553c568596b49415c8f1410317dbc
1 parent e0f9806 commit fbdba4f

2 files changed

Lines changed: 38 additions & 19 deletions

File tree

cpp/src/parquet/column/statistics.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ void TypedRowGroupStatistics<DType>::Update(
102102
}
103103
}
104104

105+
template <typename DType>
106+
const typename DType::c_type& TypedRowGroupStatistics<DType>::min() const {
107+
return min_;
108+
}
109+
110+
template <typename DType>
111+
const typename DType::c_type& TypedRowGroupStatistics<DType>::max() const {
112+
return max_;
113+
}
114+
105115
template <typename DType>
106116
void TypedRowGroupStatistics<DType>::Merge(const TypedRowGroupStatistics<DType>& other) {
107117
this->MergeCounts(other);

cpp/src/parquet/column/statistics.h

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ class TypedRowGroupStatistics : public RowGroupStatistics {
151151

152152
void Update(const T* values, int64_t num_not_null, int64_t num_null);
153153

154-
const T& min() const { return min_; }
155-
const T& max() const { return max_; }
154+
const T& min() const;
155+
const T& max() const;
156156

157157
std::string EncodeMin() override;
158158
std::string EncodeMax() override;
@@ -202,23 +202,32 @@ void TypedRowGroupStatistics<ByteArrayType>::PlainEncode(const T& src, std::stri
202202
template <>
203203
void TypedRowGroupStatistics<ByteArrayType>::PlainDecode(const std::string& src, T* dst);
204204

205-
using BoolStatistics = TypedRowGroupStatistics<BooleanType>;
206-
using Int32Statistics = TypedRowGroupStatistics<Int32Type>;
207-
using Int64Statistics = TypedRowGroupStatistics<Int64Type>;
208-
using Int96Statistics = TypedRowGroupStatistics<Int96Type>;
209-
using FloatStatistics = TypedRowGroupStatistics<FloatType>;
210-
using DoubleStatistics = TypedRowGroupStatistics<DoubleType>;
211-
using ByteArrayStatistics = TypedRowGroupStatistics<ByteArrayType>;
212-
using FLBAStatistics = TypedRowGroupStatistics<FLBAType>;
213-
214-
extern template class TypedRowGroupStatistics<BooleanType>;
215-
extern template class TypedRowGroupStatistics<Int32Type>;
216-
extern template class TypedRowGroupStatistics<Int64Type>;
217-
extern template class TypedRowGroupStatistics<Int96Type>;
218-
extern template class TypedRowGroupStatistics<FloatType>;
219-
extern template class TypedRowGroupStatistics<DoubleType>;
220-
extern template class TypedRowGroupStatistics<ByteArrayType>;
221-
extern template class TypedRowGroupStatistics<FLBAType>;
205+
typedef TypedRowGroupStatistics<BooleanType> BoolStatistics;
206+
typedef TypedRowGroupStatistics<Int32Type> Int32Statistics;
207+
typedef TypedRowGroupStatistics<Int64Type> Int64Statistics;
208+
typedef TypedRowGroupStatistics<Int96Type> Int96Statistics;
209+
typedef TypedRowGroupStatistics<FloatType> FloatStatistics;
210+
typedef TypedRowGroupStatistics<DoubleType> DoubleStatistics;
211+
typedef TypedRowGroupStatistics<ByteArrayType> ByteArrayStatistics;
212+
typedef TypedRowGroupStatistics<FLBAType> FLBAStatistics;
213+
214+
#if defined(__GNUC__) && !defined(__clang__)
215+
#pragma GCC diagnostic push
216+
#pragma GCC diagnostic ignored "-Wattributes"
217+
#endif
218+
219+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<BooleanType>;
220+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<Int32Type>;
221+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<Int64Type>;
222+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<Int96Type>;
223+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<FloatType>;
224+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<DoubleType>;
225+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<ByteArrayType>;
226+
extern template class PARQUET_EXPORT TypedRowGroupStatistics<FLBAType>;
227+
228+
#if defined(__GNUC__) && !defined(__clang__)
229+
#pragma GCC diagnostic pop
230+
#endif
222231

223232
} // namespace parquet
224233

0 commit comments

Comments
 (0)