Skip to content

Commit

Permalink
fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Dec 6, 2023
1 parent 2f78bd2 commit ea6ee4a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp-ch/local-engine/Shuffle/SelectorBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,12 @@ PartitionInfo HashSelectorBuilder::build(DB::Block & block)
}
}

const auto * selector_col = checkAndGetColumn<ColumnUInt64>(selector.get());
if (!selector_col)
auto non_const_selector = selector->convertToFullColumnIfConst();
const auto * res_col = checkAndGetColumn<ColumnUInt64>(non_const_selector.get());
if (!res_col)
throw DB::Exception(DB::ErrorCodes::LOGICAL_ERROR, "Wrong type of selector column:{} expect ColumnUInt64", selector->getName());

const DB::IColumn::Selector & partition_ids = selector_col->getData();
const DB::IColumn::Selector & partition_ids = res_col->getData();
return PartitionInfo::fromSelector(partition_ids, partition_num);
}

Expand Down

0 comments on commit ea6ee4a

Please sign in to comment.