Skip to content

Commit

Permalink
feat(clp-s): Add an initialization method in SchemaReader that passes…
Browse files Browse the repository at this point in the history
… the column map to FilterClass. (#709)
  • Loading branch information
wraymo authored Feb 6, 2025
1 parent d86e4b7 commit 0f7f433
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/core/src/clp_s/SchemaReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ void SchemaReader::initialize_filter(FilterClass* filter) {
filter->init(this, m_schema_id, m_columns);
}

void SchemaReader::initialize_filter_with_column_map(FilterClass* filter) {
filter->init(this, m_schema_id, m_column_map);
}

void SchemaReader::generate_local_tree(int32_t global_id) {
std::stack<int32_t> global_id_stack;
global_id_stack.emplace(global_id);
Expand Down
20 changes: 20 additions & 0 deletions components/core/src/clp_s/SchemaReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ class FilterClass {
std::vector<BaseColumnReader*> const& column_readers
) = 0;

/**
* Initializes the filter with a column map.
* Note: the column map only contains the ordered columns in a schema.
* @param reader
* @param schema_id
* @param column_map
*/
virtual void init(
SchemaReader* reader,
int32_t schema_id,
std::unordered_map<int32_t, BaseColumnReader*> const& column_map
) {}

/**
* Filters the message
* @param cur_message
Expand Down Expand Up @@ -180,6 +193,13 @@ class SchemaReader {
*/
void initialize_filter(FilterClass* filter);

/**
* Initializes the filter with a column map.
* Note: the column map only contains the ordered columns in a schema.
* @param filter
*/
void initialize_filter_with_column_map(FilterClass* filter);

/**
* Marks a column as timestamp
* @param column_reader
Expand Down

0 comments on commit 0f7f433

Please sign in to comment.