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

feat(binder): support implicit type conversion in binary op #301

Merged
merged 3 commits into from
Jan 16, 2022

Conversation

a9QrX3Lu
Copy link
Contributor

@a9QrX3Lu a9QrX3Lu commented Jan 16, 2022

close #280

Copy link
Collaborator

@TennyZhuang TennyZhuang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

Rest LGTM, good work!

src/binder/expression/binary_op.rs Show resolved Hide resolved
let right_physical_kind = right_data_type.physical_kind();
if left_physical_kind != right_physical_kind {
match (left_physical_kind, right_physical_kind) {
(
Copy link
Member

Choose a reason for hiding this comment

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

This pattern match seems... hard to read? I think it's better to return true / false for this match arm, and expand them in the match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment for this not-equal check, which is used for filtering the case that need to do implicit casting. And the match here is used for deciding inserting BoundTypeCast to left expr or right expr.

src/executor/evaluator.rs Outdated Show resolved Hide resolved
@a9QrX3Lu a9QrX3Lu requested a review from skyzh January 16, 2022 06:18
@a9QrX3Lu a9QrX3Lu merged commit 16ef118 into main Jan 16, 2022
@a9QrX3Lu a9QrX3Lu deleted the wzl/implicit-type-conversion branch January 16, 2022 06:27
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.

query: support implicit type cast
4 participants