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

refactor: move column operations to ColumnOperation trait #222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ssddOnTop
Copy link

@ssddOnTop ssddOnTop commented Oct 5, 2024

Rationale for this change

Now that we are including nullable column support in #183, the comment #183 (comment) suggests creating new structs for nullable columns

This trait will help us with the easy implementation of methods

What changes are included in this PR?

I introduced a trait ColumnOperation which contains the functions try_add_subtract_column_types, try_multiply_column_types and try_divide_column_types

Are these changes tested?

The refactor does not affect any core logic, and changes made are covered under the tests.

PS: ext of #194

@ssddOnTop
Copy link
Author

@JayWhite2357 can I get a reviewer assigned

right_type: rhs,
});
/// A trait for column operations.
pub trait ColumnOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

@ssddOnTop Hmm this looks like a misnomer. What's your goal here, may I ask?

Copy link
Author

Choose a reason for hiding this comment

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

@iajoiner I might be confused here but I was thinking that now we will have the normal Column and the NullableColumn so we could implement a trait for each type so that we could perform dynamic dispatch to avoid massive changes in future.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @iajoiner's point here is that you have impl ColumnOperation for ColumnType. So, it probably should be named ColumnTypeOperation.

My instinct is that a trait doesn't make sense because it's not clear what the other type that would implement it would be. ColumnType and NullableColumnType seems to be what you are thinking.

It's not clear that NullableColumnType is the right design choice here.

Even if this refactor makes sense, I would like to see other PRs come first that necessitate this refactor.

@JayWhite2357
Copy link
Contributor

@ssddOnTop are you waiting on us here? I don't see activity on this.

@ssddOnTop
Copy link
Author

@ssddOnTop are you waiting on us here? I don't see activity on this.

I was waiting for a reply on #222 (comment)

I am finding it hard to communicate here..

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.

3 participants