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

Fix update() with expressions overcalc #2328

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Fix GIL release for to_columns_string()
  • Loading branch information
texodus committed Aug 7, 2023
commit eca996ad7ca57c848a29c706d301ca16d3d3e67b
24 changes: 16 additions & 8 deletions cpp/perspective/src/cpp/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,10 +1580,10 @@ View<t_ctxunit>::to_columns(t_uindex start_row, t_uindex end_row,
bool get_pkeys, bool get_ids, bool _leaves_only, t_uindex num_sides,
bool _has_row_path, std::string nidx, t_uindex columns_length,
t_uindex group_by_length) const {

PSP_GIL_UNLOCK();
PSP_READ_LOCK(get_lock());
auto slice = get_data(start_row, end_row, start_col, end_col);
auto col_names = slice->get_column_names();
auto schema = m_ctx->get_schema();
auto& col_names = slice->get_column_names();

rapidjson::StringBuffer s;
rapidjson::Writer<rapidjson::StringBuffer> writer(s);
Expand Down Expand Up @@ -1628,9 +1628,12 @@ View<t_ctx0>::to_columns(t_uindex start_row, t_uindex end_row,
bool get_pkeys, bool get_ids, bool _leaves_only, t_uindex num_sides,
bool _has_row_path, std::string nidx, t_uindex columns_length,
t_uindex group_by_length) const {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(get_lock());
auto slice = get_data(start_row, end_row, start_col, end_col);
auto col_names = slice->get_column_names();
auto schema = m_ctx->get_schema();
const std::vector<std::vector<t_tscalar>>& col_names
= slice->get_column_names();

rapidjson::StringBuffer s;
rapidjson::Writer<rapidjson::StringBuffer> writer(s);
writer.StartObject();
Expand Down Expand Up @@ -1671,8 +1674,11 @@ View<t_ctx1>::to_columns(t_uindex start_row, t_uindex end_row,
bool get_pkeys, bool get_ids, bool leaves_only, t_uindex num_sides,
bool has_row_path, std::string nidx, t_uindex columns_length,
t_uindex group_by_length) const {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(get_lock());

auto slice = get_data(start_row, end_row, start_col, end_col);
auto col_names = slice->get_column_names();
const auto& col_names = slice->get_column_names();
rapidjson::StringBuffer s;
rapidjson::Writer<rapidjson::StringBuffer> writer(s);
writer.StartObject();
Expand Down Expand Up @@ -1721,8 +1727,10 @@ View<t_ctx2>::to_columns(t_uindex start_row, t_uindex end_row,
bool get_pkeys, bool get_ids, bool leaves_only, t_uindex num_sides,
bool has_row_path, std::string nidx, t_uindex columns_length,
t_uindex group_by_length) const {
auto slice = get_data(start_row, end_row, start_col, end_col);
auto col_names = slice->get_column_names();
PSP_GIL_UNLOCK();
PSP_READ_LOCK(get_lock());
const auto slice = get_data(start_row, end_row, start_col, end_col);
const auto& col_names = slice->get_column_names();
rapidjson::StringBuffer s;
rapidjson::Writer<rapidjson::StringBuffer> writer(s);
writer.StartObject();
Expand Down