Open RingsC opened 1 year ago
assert failed as following.
void Tianmu::core::GroupTable::Initialize(int64_t, bool): Assertion `distinct_size > 0' failed.
// pre-allocation of distinct memory
int distinct_width = 0;
int64_t distinct_size = 0;
for (int i = no_grouping_attr; i < no_attr; i++)
if (distinct[i]) {
desc = aggregated_desc[i - no_grouping_attr];
distinct_width = vc[i]->MaxStringSize() + 2;
distinct_size += desc.max_no_values * distinct_width;
}
distinct_size = int64_t(ceil(distinct_size * 1.3));
// initialize distinct tables
for (int i = no_grouping_attr; i < no_attr; i++)
if (distinct[i]) {
desc = aggregated_desc[i - no_grouping_attr];
DEBUG_ASSERT(distinct_size > 0);
gdistinct[i] = std::make_shared<GroupDistinctTable>(p_power);
gdistinct[i]->InitializeVC(vm_tab->RowNumberScope(), vc[i], desc.max_no_values,
distinct_size / no_columns_with_distinct,
(operation[i] != GT_Aggregation::GT_COUNT_NOT_NULL)); // otherwise must be decodable
gdistinct[i]->CopyFromValueMatchingTable(vm_tab.get());
distinct_size -= gdistinct[i]->BytesTaken();
no_columns_with_distinct--;
}
// initialize everything
Transaction *m_conn = current_txn_;
From the code, after initialization. we assume that distinct_size
should be greater than 0. but, here, assert failed. it means that distinct_size
maybe equals to 0.
Here, we can add one assertion statement to test distinct_size
when and why it equals to 0.
if (distinct_size ==0) DEBUG_ASSERT(false);
Have you read the Contributing Guidelines on issues?
Please confirm if bug report does NOT exists already ?
Describe the problem
Expected behavior
No response
How To Reproduce
No response
Environment
No response
Are you interested in submitting a PR to solve the problem?