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

support comparison for decimal data type and refactor the binary coercion rule #1483

Merged
merged 7 commits into from
Jan 14, 2022

Conversation

liukun4515
Copy link
Contributor

@liukun4515 liukun4515 commented Dec 24, 2021

Which issue does this PR close?

part of #122

  • refactor the coercion rule for binary operation: it's helpful to extend other operations for binary.
  • support comparison operation for decimal type.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Dec 24, 2021
@liukun4515 liukun4515 changed the title support comparison for decimal data type support comparison for decimal data type and refactor the binary coercion rule Dec 24, 2021
@liukun4515 liukun4515 force-pushed the comparsion_decimal_support branch from 1684d63 to ed8ef8f Compare December 26, 2021 06:14
@@ -501,58 +706,6 @@ macro_rules! compute_utf8_flag_op_scalar {
}};
}

/// Coercion rules for all binary operators. Returns the output type
/// of applying `op` to an argument of `lhs_type` and `rhs_type`.
fn common_binary_type(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move the main code to the file of binary_rule.rs.

@liukun4515 liukun4515 marked this pull request as ready for review January 13, 2022 04:21
@alamb
Copy link
Contributor

alamb commented Jan 13, 2022

I will review this tomorrow if no one else gets to it first. I ran out of time for today to review code

@liukun4515
Copy link
Contributor Author

I will review this tomorrow if no one else gets to it first. I ran out of time for today to review code

We can merge the cast/try_cast pull request first.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I went through this pretty carefully -- nice work @liukun4515 . Thank you for the contribution

the only other thing I think would be helpful would be some end to end tests (e.g. in tests/sql) demonstrating doing operations (like adding a decimal to an int). However, I also think that would be fine to do as a follow on PR

@alamb alamb merged commit 1c39f5c into apache:master Jan 14, 2022
@liukun4515
Copy link
Contributor Author

eview this tomorrow if no one else g

tracked in the subtask #122 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants