Skip to content

Commit 732b761

Browse files
committed
Partial revert #2972, #2964
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 8a4d95a commit 732b761

File tree

14 files changed

+135
-332
lines changed

14 files changed

+135
-332
lines changed

cpp/perspective/src/cpp/base.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -799,19 +799,6 @@ type_to_dtype<void*>() {
799799
return DTYPE_OBJECT;
800800
}
801801

802-
std::ostream&
803-
operator<<(std::ostream& os, const t_op& op) {
804-
#define X(NAME) \
805-
case NAME: \
806-
os << #NAME; \
807-
break;
808-
809-
switch (op) { FOREACH_T_OP(X) }
810-
#undef X
811-
812-
return os;
813-
}
814-
815802
} // end namespace perspective
816803

817804
namespace std {

cpp/perspective/src/cpp/context_zero.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
1111
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

13-
#include "perspective/base.h"
14-
#include "perspective/raw_types.h"
1513
#include <perspective/first.h>
1614
#include <perspective/context_base.h>
1715
#include <perspective/get_data_extents.h>
@@ -103,7 +101,6 @@ t_ctx0::notify(
103101
flattened.get_const_column("psp_pkey");
104102
std::shared_ptr<const t_column> op_sptr =
105103
flattened.get_const_column("psp_op");
106-
auto old_pkey_col = flattened.get_column("psp_old_pkey");
107104
const t_column* pkey_col = pkey_sptr.get();
108105
const t_column* op_col = op_sptr.get();
109106

@@ -176,20 +173,11 @@ t_ctx0::notify(
176173
m_symtable.get_interned_tscalar(pkey_col->get_scalar(idx));
177174
std::uint8_t op_ = *(op_col->get_nth<std::uint8_t>(idx));
178175
t_op op = static_cast<t_op>(op_);
179-
const auto existed = *(existed_col->get_nth<bool>(idx));
180-
const auto old_pkey = old_pkey_col->get_scalar(idx);
176+
bool existed = *(existed_col->get_nth<bool>(idx));
181177

182178
switch (op) {
183179
case OP_INSERT: {
184-
if (old_pkey.is_valid()) {
185-
m_traversal->move_row(
186-
*m_gstate,
187-
*(m_expression_tables->m_master),
188-
m_config,
189-
old_pkey,
190-
pkey
191-
);
192-
} else if (existed) {
180+
if (existed) {
193181
m_traversal->update_row(
194182
*m_gstate,
195183
*(m_expression_tables->m_master),

cpp/perspective/src/cpp/data_table.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
#include <sstream>
2424
#include <utility>
2525
namespace perspective {
26-
std::ostream&
27-
operator<<(std::ostream& os, const t_flatten_record& fr) {
28-
os << "store_idx: " << fr.m_store_idx << ", bidx: " << fr.m_begin_idx
29-
<< ", eidx: " << fr.m_edge_idx;
30-
return os;
31-
}
3226

3327
void
3428
t_data_table::set_capacity(t_uindex idx) {
@@ -325,15 +319,15 @@ t_data_table::get_schema() const {
325319
}
326320

327321
std::shared_ptr<t_data_table>
328-
t_data_table::flatten(t_uindex limit) const {
322+
t_data_table::flatten() const {
329323
PSP_TRACE_SENTINEL();
330324
PSP_VERBOSE_ASSERT(m_init, "touching uninited object");
331325
PSP_VERBOSE_ASSERT(is_pkey_table(), "Not a pkeyed table");
332326
std::shared_ptr<t_data_table> flattened = std::make_shared<t_data_table>(
333327
"", "", m_schema, DEFAULT_EMPTY_CAPACITY, BACKING_STORE_MEMORY
334328
);
335329
flattened->init();
336-
flatten_body<std::shared_ptr<t_data_table>>(flattened, limit);
330+
flatten_body<std::shared_ptr<t_data_table>>(flattened);
337331
return flattened;
338332
}
339333

@@ -641,13 +635,6 @@ t_data_table::join(const std::shared_ptr<t_data_table>& other_table) const {
641635
PSP_VERBOSE_ASSERT(m_init, "touching uninited object");
642636

643637
if (size() != other_table->size()) {
644-
#if PSP_DEBUG
645-
LOG_DEBUG("Joining current table:");
646-
pprint();
647-
LOG_DEBUG("on this this table:");
648-
other_table->pprint();
649-
#endif
650-
651638
std::stringstream ss;
652639
ss << "[t_data_table::join] Cannot join two tables of unequal sizes! "
653640
"Current size: "

cpp/perspective/src/cpp/flat_traversal.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -388,28 +388,6 @@ t_ftrav::delete_row(t_tscalar pkey) {
388388
++m_step_deletes;
389389
}
390390

391-
void
392-
t_ftrav::move_row(
393-
const t_gstate& gstate,
394-
const t_data_table& expression_master_table,
395-
const t_config& config,
396-
t_tscalar old_pkey,
397-
t_tscalar new_pkey
398-
) {
399-
auto old_pkiter = m_pkeyidx.find(old_pkey);
400-
bool old_pkey_existed = old_pkiter != m_pkeyidx.end();
401-
if (!old_pkey_existed) {
402-
LOG_DEBUG("Tried to move pkey that doesn't exist: " << old_pkey);
403-
return;
404-
}
405-
LOG_DEBUG("Moving pkey from: " << old_pkey << " to: " << new_pkey);
406-
407-
(*m_index)[old_pkiter->second].m_deleted = true;
408-
t_mselem mselem;
409-
fill_sort_elem(gstate, expression_master_table, config, new_pkey, mselem);
410-
m_new_elems[new_pkey] = mselem;
411-
}
412-
413391
std::vector<t_sortspec>
414392
t_ftrav::get_sort_by() const {
415393
return m_sortby;

cpp/perspective/src/cpp/gnode.cpp

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
1111
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1212

13-
#include "perspective/raw_types.h"
1413
#include <perspective/first.h>
1514
#include <perspective/context_unit.h>
1615
#include <perspective/context_zero.h>
@@ -49,9 +48,7 @@ calc_negate(t_tscalar val) {
4948
return val.negate();
5049
}
5150

52-
t_gnode::t_gnode(
53-
t_schema input_schema, t_schema output_schema, t_uindex limit
54-
) :
51+
t_gnode::t_gnode(t_schema input_schema, t_schema output_schema) :
5552
m_mode(NODE_PROCESSING_SIMPLE_DATAFLOW)
5653
#ifdef PSP_PARALLEL_FOR
5754
,
@@ -63,7 +60,6 @@ t_gnode::t_gnode(
6360
m_output_schema(std::move(output_schema)),
6461
m_init(false),
6562
m_id(0),
66-
m_limit(limit),
6763
m_last_input_port_id(0),
6864
m_pool_cleanup([]() {}) {
6965
PSP_TRACE_SENTINEL();
@@ -89,10 +85,6 @@ t_gnode::t_gnode(
8985
existed_schema
9086
};
9187
m_epoch = std::chrono::high_resolution_clock::now();
92-
93-
m_input_schema.add_column(
94-
"psp_old_pkey", m_input_schema.get_dtype("psp_pkey")
95-
);
9688
}
9789

9890
t_gnode::~t_gnode() {
@@ -105,8 +97,7 @@ void
10597
t_gnode::init() {
10698
PSP_TRACE_SENTINEL();
10799

108-
m_gstate =
109-
std::make_shared<t_gstate>(m_input_schema, m_output_schema, m_limit);
100+
m_gstate = std::make_shared<t_gstate>(m_input_schema, m_output_schema);
110101
m_gstate->init();
111102

112103
// Create and store the main input port, which is always port 0. The next
@@ -132,7 +123,7 @@ t_gnode::init() {
132123

133124
for (const auto& iter : m_input_ports) {
134125
std::shared_ptr<t_port> input_port = iter.second;
135-
input_port->get_table()->flatten(m_limit);
126+
input_port->get_table()->flatten();
136127
}
137128

138129
// Initialize expression-related state
@@ -307,22 +298,16 @@ t_gnode::_process_table(t_uindex port_id) {
307298
}
308299

309300
m_was_updated = true;
310-
flattened = input_port->get_table()->flatten(m_limit);
301+
flattened = input_port->get_table()->flatten();
311302

312303
PSP_GNODE_VERIFY_TABLE(flattened);
313304
PSP_GNODE_VERIFY_TABLE(get_table());
314305

315306
t_uindex flattened_num_rows = flattened->num_rows();
307+
316308
std::vector<t_rlookup> row_lookup(flattened_num_rows);
317309
t_column* pkey_col = flattened->get_column("psp_pkey").get();
318310

319-
#if PSP_DEBUG
320-
LOG_DEBUG("m_mapping");
321-
for (const auto [k, v] : m_gstate->get_pkey_map()) {
322-
LOG_DEBUG("KEY: " << k << " , VALUE: " << v);
323-
}
324-
#endif
325-
326311
for (t_uindex idx = 0; idx < flattened_num_rows; ++idx) {
327312
// See if each primary key in flattened already exist in the dataset
328313
t_tscalar pkey = pkey_col->get_scalar(idx);

0 commit comments

Comments
 (0)