Skip to content

Commit

Permalink
Fix the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
st-pasha committed Dec 9, 2020
1 parent 7e14035 commit 37917e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/column/view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ ArrayView_ColumnImpl<T>::ArrayView_ColumnImpl(
: Virtual_ColumnImpl(nrows, col.stype()),
arg(std::move(col))
{
xassert((std::is_same<T, int32_t>::value? ri.isarr32() : ri.isarr64()));
xassert(ri.max() < arg.nrows());
set_rowindex(ri);
}

template <typename T>
void ArrayView_ColumnImpl<T>::set_rowindex(const RowIndex& ri) {
xassert((std::is_same<T, int32_t>::value? ri.isarr32() : ri.isarr64()));
xassert(ri.max() < arg.nrows());
rowindex_container = ri;
indices = get_indices<T>(ri);
}
Expand Down
10 changes: 9 additions & 1 deletion src/core/sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,15 @@ void dt::ArrayView_ColumnImpl<T>::sort_grouped(
(void) out.stats();
SortContext sc(nrows(), rowindex_container, grps, /*make_groups=*/ false);
sc.continue_sort(arg, /*desc=*/ false, /*make_groups=*/ false);
set_rowindex(sc.get_result_rowindex());
if (sizeof(T) == 4) {
set_rowindex(sc.get_result_rowindex());
} else {
// Since SortContext produces an ARR32 rowindex, and the current
// ArrayView_ColumnImpl is int64, we need to replace the column
// with the new which uses int32s.
out = Column(new dt::ArrayView_ColumnImpl<int32_t>(
std::move(arg), sc.get_result_rowindex(), nrows_));
}
}

template class dt::ArrayView_ColumnImpl<int32_t>;
Expand Down

0 comments on commit 37917e7

Please sign in to comment.