mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
PARQUET-1494: Recognize statistics built with UNSIGNED sort order by parquet-mr 1.10.0 onwards
This commit is contained in:
1 parent
5a75bb264d
commit
029f73047d
2 files changed
+10
-2
No files matched your search
@@ -47,6 +47,11 @@ const ApplicationVersion& ApplicationVersion::PARQUET_CPP_FIXED_STATS_VERSION()
|
||||
return version;
|
||||
}
|
||||
|
||||
const ApplicationVersion& ApplicationVersion::PARQUET_MR_FIXED_STATS_VERSION() {
|
||||
static ApplicationVersion version("parquet-cpp", 1, 10, 0);
|
||||
return version;
|
||||
}
|
||||
|
||||
std::string ParquetVersionToString(ParquetVersion::type ver) {
|
||||
switch (ver) {
|
||||
case ParquetVersion::PARQUET_1_0:
|
||||
@@ -547,8 +552,10 @@ bool ApplicationVersion::VersionEq(const ApplicationVersion& other_version) cons
|
||||
bool ApplicationVersion::HasCorrectStatistics(Type::type col_type,
|
||||
EncodedStatistics& statistics,
|
||||
SortOrder::type sort_order) const {
|
||||
// Parquet cpp version 1.3.0 onwards stats are computed correctly for all types
|
||||
if ((application_ != "parquet-cpp") || (VersionLt(PARQUET_CPP_FIXED_STATS_VERSION()))) {
|
||||
// parquet-cpp version 1.3.0 and parquet-mr 1.10.0 onwards stats are computed
|
||||
// correctly for all types
|
||||
if ((application_ == "parquet-cpp" && VersionLt(PARQUET_CPP_FIXED_STATS_VERSION()))
|
||||
|| (application_ == "parquet-mr" && VersionLt(PARQUET_MR_FIXED_STATS_VERSION()))) {
|
||||
// Only SIGNED are valid unless max and min are the same
|
||||
// (in which case the sort order does not matter)
|
||||
bool max_equals_min = statistics.has_min && statistics.has_max
|
||||
|
||||
@@ -43,6 +43,7 @@ class PARQUET_EXPORT ApplicationVersion {
|
||||
static const ApplicationVersion& PARQUET_251_FIXED_VERSION();
|
||||
static const ApplicationVersion& PARQUET_816_FIXED_VERSION();
|
||||
static const ApplicationVersion& PARQUET_CPP_FIXED_STATS_VERSION();
|
||||
static const ApplicationVersion& PARQUET_MR_FIXED_STATS_VERSION();
|
||||
// Regular expression for the version format
|
||||
// major . minor . patch unknown - prerelease.x + build info
|
||||
// Eg: 1.5.0ab-cdh5.5.0+cd
|
||||
|
||||
Reference in new issue
Block a user