Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler implementation of aggregate fix #220

Merged
merged 1 commit into from
Aug 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions packages/perspective/src/cpp/gnode_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,36 +504,20 @@ t_gstate::read_column(const t_str& colname,
t_col_csptr col = m_table->get_const_column(colname);
const t_column* col_ = col.get();

if (include_nones)
t_f64vec rval;
for (t_index idx = 0; idx < num; ++idx)
{
t_f64vec rval(num);
for (t_index idx = 0; idx < num; ++idx)
{
t_mapping::const_iterator iter = m_mapping.find(pkeys[idx]);
if (iter != m_mapping.end())
{
rval[idx] = col_->get_scalar(iter->second).to_double();
}
}
std::swap(rval, out_data);
t_mapping::const_iterator iter = m_mapping.find(pkeys[idx]);
if (iter != m_mapping.end())
{
auto tscalar = col_->get_scalar(iter->second);
if (include_nones || tscalar.is_valid())
{
rval.push_back(tscalar.to_double());
}
}
}
else
{
t_f64vec rval;
for (t_index idx = 0; idx < num; ++idx)
{
t_mapping::const_iterator iter = m_mapping.find(pkeys[idx]);
if (iter != m_mapping.end())
{
auto tscalar = col_->get_scalar(iter->second);
if (tscalar.is_valid())
{
rval.push_back(tscalar.to_double());
}
}
}
std::swap(rval, out_data);
}
std::swap(rval, out_data);
}

t_tscalar
Expand Down