-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
372 additions
and
180 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#include "arrow/api.h" | ||
|
||
#include "AndFilter.h" | ||
|
||
AndFilter::AndFilter(std::string column_name, std::shared_ptr<Filter> left, std::shared_ptr<Filter> right) | ||
: _column_name(column_name), _left(left), _right(right) | ||
{ | ||
|
||
} | ||
|
||
void | ||
AndFilter::initialize(TableCursor& table_cursor) { | ||
_left->initialize(table_cursor); | ||
_right->initialize(table_cursor); | ||
} | ||
|
||
bool | ||
AndFilter::evaluate() | ||
{ | ||
// short circuit explicitly | ||
if (_left->evaluate()) { | ||
return _right->evaluate(); | ||
} else { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
#ifndef ANDFILTER_H | ||
#define ANDFILTER_H | ||
|
||
#include <string> | ||
#include "filters/Filter.h" | ||
#include "TableCursor.h" | ||
|
||
class AndFilter : public Filter { | ||
public: | ||
|
||
AndFilter(std::string column_name, std::shared_ptr<Filter> left, std::shared_ptr<Filter> right); | ||
|
||
void initialize(TableCursor& table_cursor) override; | ||
|
||
bool evaluate() override; | ||
|
||
private: | ||
|
||
std::string _column_name; | ||
|
||
std::shared_ptr<Filter> _left; | ||
|
||
std::shared_ptr<Filter> _right; | ||
|
||
}; | ||
|
||
|
||
#endif // ANDFILTER_H |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
|
||
#include "LessThanFilter.h" | ||
|
||
#include "arrow/api.h" | ||
|
||
LessThanFilter::LessThanFilter(std::string column_name, double value) | ||
: _column_name(column_name), _value(value) | ||
{ | ||
|
||
} | ||
|
||
void | ||
LessThanFilter::initialize(TableCursor& table_cursor) { | ||
_cursor = std::dynamic_pointer_cast<ColumnCursorWrapper<arrow::DoubleArray>>( | ||
table_cursor.getColumn(_column_name)); | ||
} | ||
|
||
bool | ||
LessThanFilter::evaluate() | ||
{ | ||
return _cursor->get() < _value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
#ifndef LESSTHANFILTER_H | ||
#define LESSTHANFILTER_H | ||
|
||
#include <string> | ||
#include "filters/Filter.h" | ||
#include "TableCursor.h" | ||
#include "ColumnCursorWrapper.h" | ||
|
||
class LessThanFilter : public Filter { | ||
public: | ||
|
||
LessThanFilter(std::string column_name, double value); | ||
|
||
void initialize(TableCursor &table_cursor) override; | ||
|
||
bool evaluate() override; | ||
|
||
private: | ||
|
||
std::string _column_name; | ||
|
||
double _value; | ||
|
||
std::shared_ptr <ColumnCursorWrapper<arrow::DoubleArray>> _cursor; | ||
}; | ||
|
||
|
||
#endif // LESSTHANFILTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters