Skip to content

Conversation

@kazantsev-maksim
Copy link
Contributor

@kazantsev-maksim kazantsev-maksim commented Jan 5, 2026

Which issue does this PR close?

N/A

Rationale for this change

What changes are included in this PR?

How are these changes tested?

Test added as part of this PR.

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.54%. Comparing base (f09f8af) to head (ce60509).
⚠️ Report is 833 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3036      +/-   ##
============================================
+ Coverage     56.12%   59.54%   +3.41%     
- Complexity      976     1381     +405     
============================================
  Files           119      167      +48     
  Lines         11743    15537    +3794     
  Branches       2251     2576     +325     
============================================
+ Hits           6591     9251    +2660     
- Misses         4012     4989     +977     
- Partials       1140     1297     +157     

☔ 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.


test("size - respect to legacySizeOfNull") {
val table = "t1"
withSQLConf(CometConf.COMET_NATIVE_SCAN_IMPL.key -> CometConf.SCAN_NATIVE_ICEBERG_COMPAT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to make sure the ansi mode is off here. According to Spark

This function returns -1 for null input only if spark.sql.ansi.enabled is false and spark.sql.legacy.sizeOfNull is true. Otherwise, it returns null for null input. With the default settings, the function returns null for null input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @comphead. ANSI mode is disabled by default, but for safety, I've explicitly added the setting.

for {
isNotNullExprProto <- createIsNotNullExprProto(expr, inputs, binding)
sizeScalarExprProto <- scalarFunctionExprToProto("size", arrayExprProto)
emptyLiteralExprProto <- createLiteralExprProto(expr.legacySizeOfNull)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also refer to ansi mode?

Copy link
Contributor Author

@kazantsev-maksim kazantsev-maksim Jan 8, 2026

Choose a reason for hiding this comment

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

For more safety, I used SQLConf.get.legacySizeOfNull.

image

@comphead
Copy link
Contributor

comphead commented Jan 9, 2026

Thanks the PR makes sense to me, waiting for the CI

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