-
Notifications
You must be signed in to change notification settings - Fork 164
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
Implement Append for ColumnTuple #126
Conversation
I implemented Slice as well, this should now resolve #32 as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for a PR!
Please fix according to comments, and add some unit-tests (you may add some to columns_ut.cpp
)
clickhouse/columns/tuple.cpp
Outdated
"to column type " + this->Type()->GetName()); | ||
} | ||
for (size_t ci = 0; ci < columns_.size(); ci++) { | ||
columns_[ci]->Append((*column->As<ColumnTuple>())[ci]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case (with ->As<ColumnTuple>
) should be moved outside for
loop.
@@ -22,7 +22,7 @@ class ColumnTuple : public Column { | |||
|
|||
public: | |||
/// Appends content of given column to the end of current one. | |||
void Append(ColumnRef) override { } | |||
void Append(ColumnRef column) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some unit tests that validate implementation of ColumnTuple::Append()
, both positive and negative cases.
@@ -37,7 +37,7 @@ class ColumnTuple : public Column { | |||
size_t Size() const override; | |||
|
|||
/// Makes slice of the current column. | |||
ColumnRef Slice(size_t, size_t) const override { return ColumnRef(); } | |||
ColumnRef Slice(size_t, size_t) const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some unit tests that validate implementation of ColumnTuple::Slice()
, both positive and negative cases.
I added some unit tests for the append and slice case, I'm not quite sure what you mean with the negative case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This closes #115 and also adds the option to Append Tuples to
ColumnTuples
.