Skip to content

Commit

Permalink
add DCHECK for path containing selector
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz committed Nov 4, 2019
1 parent 1bae5ff commit f2f9689
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/src/arrow/dataset/partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ Result<std::shared_ptr<Expression>> HivePartitionScheme::Parse(
Status ApplyPartitionScheme(const PartitionScheme& scheme, const fs::Selector& selector,
std::vector<fs::FileStats> 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<Expression> partition;
RETURN_NOT_OK(scheme.Parse(path, &partition));
Expand Down

0 comments on commit f2f9689

Please sign in to comment.