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

Adds the unsafe DECIMAL to integer downcasts #1342

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

rchowell
Copy link
Contributor

Relevant Issues

The following explicit/unsafe casts were missing in the type definitions.

CAST(<decimal> AS INT2)     -- > int16l|missing
CAST(<decimal> AS INT4)     -- > int32|missing
CAST(<decimal> AS INT8)     -- > int64|missing
CAST(<decimal> AS BIGINT)   -- > int64|missing
CAST(<decimal> AS INT)      -- > int|missing

Description

Adds the unsafe DECIMAL to integer downcasts.

Other Information

  • Updated Unreleased Section in CHANGELOG: [YES/NO]
    No

  • Any backward-incompatible changes? [YES/NO]
    No

  • Any new external dependencies? [YES/NO]
    No

  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES/NO]
    Yes

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchowell rchowell requested a review from yliuuuu January 19, 2024 00:15
Copy link

github-actions bot commented Jan 19, 2024

Conformance comparison report

Base (1e1a71f) 3cd4498 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (1e1a71f) but now fail: 0

Number failing in Base (1e1a71f) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (dae1ab3) 72.17% compared to head (06e9da6) 72.15%.
Report is 1 commits behind head on main.

Files Patch % Lines
.../org/partiql/lang/syntax/impl/PartiQLPigVisitor.kt 90.24% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1342      +/-   ##
============================================
- Coverage     72.17%   72.15%   -0.02%     
+ Complexity     2097     2095       -2     
============================================
  Files           221      221              
  Lines         15973    15984      +11     
  Branches       2892     2896       +4     
============================================
+ Hits          11528    11534       +6     
- Misses         3639     3641       +2     
- Partials        806      809       +3     
Flag Coverage Δ
CLI 11.86% <ø> (ø)
EXAMPLES 80.28% <ø> (ø)
LANG 80.78% <90.24%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 284 to 289
INT8 to unsafe(),
INT16 to unsafe(),
INT32 to unsafe(),
INT64 to unsafe(),
INT to unsafe(),
DECIMAL to unsafe(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make those explicit as well, for consistent with DECIMAL since right now we are kind of inflating those two types during inferring.

Copy link
Contributor

@yliuuuu yliuuuu left a comment

Choose a reason for hiding this comment

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

LGTM.

@rchowell rchowell merged commit 05c591c into main Jan 19, 2024
10 checks passed
@rchowell rchowell deleted the decimal-cast-fix branch January 19, 2024 17:36
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