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

Implement Append for ColumnTuple #126

Merged
merged 4 commits into from
Feb 2, 2022
Merged

Conversation

timoll
Copy link
Contributor

@timoll timoll commented Dec 15, 2021

This closes #115 and also adds the option to Append Tuples to ColumnTuples.

@CLAassistant
Copy link

CLAassistant commented Dec 15, 2021

CLA assistant check
All committers have signed the CLA.

@timoll
Copy link
Contributor Author

timoll commented Dec 21, 2021

I implemented Slice as well, this should now resolve #32 as well.

Copy link
Collaborator

@Enmk Enmk left a 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)

"to column type " + this->Type()->GetName());
}
for (size_t ci = 0; ci < columns_.size(); ci++) {
columns_[ci]->Append((*column->As<ColumnTuple>())[ci]);
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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.

@timoll
Copy link
Contributor Author

timoll commented Jan 20, 2022

I added some unit tests for the append and slice case, I'm not quite sure what you mean with the negative case.

Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Enmk Enmk merged commit 1ab8769 into ClickHouse:master Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Appending an Array of Tuples to a Column fails.
3 participants