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

[CALCITE-3281] Support mixed Primitive types for BinaryExpression evaluate method. #1399

Merged
merged 1 commit into from Dec 5, 2019

Conversation

yanlin-Lynn
Copy link
Contributor

Currently, the value of expression0 and expression1 must be the same type. Otherwise we might a ClassCastException, as shown in JIRA CALCITE-3281.

This PR is an improvement to support using different primitive types for expression0 and expression1 of BinaryExpression, so that, make it suite for evaluate in more cases.

Copy link
Contributor

@zinking zinking left a comment

Choose a reason for hiding this comment

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

//return ((Number) expression.evaluate(evaluator)).intValue();

will it still throw when casting to Number ?

@yanlin-Lynn
Copy link
Contributor Author

//return ((Number) expression.evaluate(evaluator)).intValue();

will it still throw when casting to Number ?

No, it will not.

@asereda-gs asereda-gs merged commit 67ed322 into apache:master Dec 5, 2019
@asereda-gs
Copy link
Member

Thanks for PR, @yanlin-Lynn !

@yanlin-Lynn yanlin-Lynn deleted the yanlin-binaryExpr branch December 6, 2019 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants