diff --git a/cpp/src/arrow/dataset/partition.cc b/cpp/src/arrow/dataset/partition.cc index bf11d8e5bdfdf..a542db1f87e3a 100644 --- a/cpp/src/arrow/dataset/partition.cc +++ b/cpp/src/arrow/dataset/partition.cc @@ -91,6 +91,9 @@ Result> HivePartitionScheme::Parse( Status ApplyPartitionScheme(const PartitionScheme& scheme, const fs::Selector& selector, std::vector files, PathPartitions* out) { for (const auto& file : files) { + // XXX is this the right way to drop the base dir? + DCHECK(std::equal(selector.base_dir.begin(), selector.base_dir.end(), + file.path().begin())); const auto& path = file.path().substr(selector.base_dir.size()); std::shared_ptr partition; RETURN_NOT_OK(scheme.Parse(path, &partition));