Skip to content

fix: fall back on nested types for default values #1799

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

Merged
merged 8 commits into from
May 28, 2025

Conversation

mbutrovich
Copy link
Contributor

Which issue does this PR close?

Partially address #1545.

Rationale for this change

#1756 added default value support for native_datafusion scan. However, this only works for Literals. If the default values are nested types, we can't yet serialize those to the native side for the scan operator to use. This PR adds a fallback for that scenario.

What changes are included in this PR?

Enhanced CometScanRule to look for default values that are not Literals.

How are these changes tested?

Now passes Spark SQL tests:

  • SPARK-39557 INSERT INTO statements with tables with array defaults
  • SPARK-39557 INSERT INTO statements with tables with struct defaults
  • SPARK-39557 INSERT INTO statements with tables with map defaults

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Thanks @mbutrovich

@codecov-commenter
Copy link

codecov-commenter commented May 27, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 59.44%. Comparing base (f09f8af) to head (c6ee979).
Report is 220 commits behind head on main.

Files with missing lines Patch % Lines
...n/scala/org/apache/comet/rules/CometScanRule.scala 25.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1799      +/-   ##
============================================
+ Coverage     56.12%   59.44%   +3.31%     
- Complexity      976     1143     +167     
============================================
  Files           119      128       +9     
  Lines         11743    12538     +795     
  Branches       2251     2357     +106     
============================================
+ Hits           6591     7453     +862     
+ Misses         4012     3892     -120     
- Partials       1140     1193      +53     

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

Copy link
Contributor

@parthchandra parthchandra left a comment

Choose a reason for hiding this comment

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

lgtm

@andygrove andygrove merged commit bab70d2 into apache:main May 28, 2025
68 checks passed
@mbutrovich mbutrovich deleted the nested_default_values branch May 29, 2025 17:00
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.

6 participants