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

IGNITE-20000: Add planner test to verify numeric type coercion in binary arithmetic #2583

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

ygerzhedovich
Copy link
Contributor

…ary arithmetic

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes


forTypePair(NumericPair.TINYINT_DOUBLE)
.firstOpBeSame()
.secondOpMatches(castTo(Types.DECIMAL_30_15)),
Copy link
Contributor

Choose a reason for hiding this comment

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

i just still don`t understand is it correct behavior or we need additional issue, probably @lowka may help here?
Overall looks good.

Copy link
Contributor

Choose a reason for hiding this comment

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

With @lowka help seems it raised from :
org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion#implicitCast

// FLOAT/DOUBLE -> DECIMAL
if (SqlTypeUtil.isApproximateNumeric(in) && expected == SqlTypeFamily.EXACT_NUMERIC) {
  return factory.decimalOf(in);
}

org.apache.calcite.rel.type.RelDataTypeFactoryImpl#decimalOf2 <-- here

@zstan
Copy link
Contributor

zstan commented Sep 18, 2023

@ygerzhedovich PR heading need to be fixed.

@zstan zstan changed the title IGNITE-20000: Add planner test to verify numeric type coercion in bin… IGNITE-20000: Add planner test to verify numeric type coercion in binary arithmetic Sep 19, 2023
@korlov42 korlov42 merged commit ffb7a42 into apache:main Sep 20, 2023
1 check passed
@korlov42 korlov42 deleted the ignite-20000 branch September 20, 2023 10:29
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