Skip to content

Conversation

@andy-hf-kwok
Copy link
Contributor

Which issue does this PR close?

This PR aims to address the -Wnumeric-widen warning in the codebase.
As the overall scope of strict-warning compliance is quite large, this change focuses on resolving this specific warning type as a first step. Future PRs will continue addressing other warning incrementally.

Partially closes #. #2255

Rationale for this change

To clean up the code as per static check with the hope to resolve all warning and promote the restrict warning profile for the default CI build to uphold Scala code quality.

What changes are included in this PR?

To perform explicit type conversion instead of relying on runtime implicit cast.

How are these changes tested?

  • Code can now compile with -Wnumeric-widen option on.
  • CI continue to pass

Signed-off-by: Andy HF Kwok <[email protected]>
Signed-off-by: Andy HF Kwok <[email protected]>
Signed-off-by: Andy HF Kwok <[email protected]>
Signed-off-by: Andy HF Kwok <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.30%. Comparing base (f09f8af) to head (a1f1b3c).
⚠️ Report is 643 commits behind head on main.

Files with missing lines Patch % Lines
...e/spark/sql/comet/CometBroadcastExchangeExec.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2588      +/-   ##
============================================
+ Coverage     56.12%   59.30%   +3.18%     
- Complexity      976     1444     +468     
============================================
  Files           119      146      +27     
  Lines         11743    13747    +2004     
  Branches       2251     2353     +102     
============================================
+ Hits           6591     8153    +1562     
- Misses         4012     4373     +361     
- Partials       1140     1221      +81     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

<arg>-feature</arg>
<arg>-Xlint:_</arg>
<arg>-Ywarn-dead-code</arg>
<!-- <arg>-deprecation</arg>-->
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these intended changes down here?

record.add(0, i % 2 == 0)
record.add(1, i.toByte)
record.add(2, i.toShort)
record.add(1, i.toByte.toInt)
Copy link
Contributor

Choose a reason for hiding this comment

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

its probably can be directly casted to int?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe overflow behaviour will be different and lead to unexpected and incorrect results

record.add(0, i % 2 == 0)
record.add(1, i.toByte)
record.add(2, i.toShort)
record.add(1, i.toByte.toInt)
Copy link
Contributor

Choose a reason for hiding this comment

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

same, can be probably converted directly

case Some(i) =>
record.add(0, i.toByte)
record.add(1, i.toShort)
record.add(0, i.toByte.toInt)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

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.

5 participants