Skip to content

Conversation

comphead
Copy link
Contributor

@comphead comphead commented Aug 1, 2025

Which issue does this PR close?

Closes #1977 #1929
Replaces accidentally closed #1978

Rationale for this change

What changes are included in this PR?

How are these changes tested?

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 90.26549% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.27%. Comparing base (f09f8af) to head (4dfc087).
⚠️ Report is 368 commits behind head on main.

Files with missing lines Patch % Lines
.../scala/org/apache/comet/serde/QueryPlanSerde.scala 93.45% 4 Missing and 3 partials ⚠️
...scala/org/apache/comet/expressions/CometCast.scala 0.00% 1 Missing and 2 partials ⚠️
.../main/scala/org/apache/comet/DataTypeSupport.scala 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2057      +/-   ##
============================================
+ Coverage     56.12%   58.27%   +2.14%     
- Complexity      976     1253     +277     
============================================
  Files           119      141      +22     
  Lines         11743    13310    +1567     
  Branches       2251     2391     +140     
============================================
+ Hits           6591     7756    +1165     
- Misses         4012     4322     +310     
- Partials       1140     1232      +92     

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

@comphead comphead marked this pull request as ready for review August 4, 2025 23:26
@@ -272,8 +273,7 @@ class CometArrayExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelp
}
}

// https://github.com/apache/datafusion-comet/issues/1929
ignore("array_contains - array literals") {
test("array_contains - array literals") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

runs now

@comphead
Copy link
Contributor Author

comphead commented Aug 7, 2025

@andygrove @mbutrovich @parthchandra please take a look

repeated string string_values = 8;
repeated bytes bytes_values = 9;
repeated bytes decimal_values = 10;
repeated ListLiteral list_values = 11;
Copy link
Contributor

@mbutrovich mbutrovich Aug 7, 2025

Choose a reason for hiding this comment

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

Is this for future support of lists within lists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct


option java_package = "org.apache.comet.serde";

message ListLiteral {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use an enum here. maybe?

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 @parthchandra for the review, please help me to understand enum proposal? enum can define types variants

enum Type {
 BOOLEAN = 0,
 etc
}

and to send data across boundaries as bytes?

If it is, can it be considered as follow up PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct. If the ListLiteral is an enum type then you will need only one field instead of multiple fields only one of which can be populated.
So

  enum LiteralValueType {
    BOOLEAN = 0,
    ...
  }
  message ListLiteral {
    LiteralValueType value
  }

Just realized that I'm not sure if it will work with nested lists though.
Maybe you can try this is in a follow up PR.

@comphead
Copy link
Contributor Author

@parthchandra @mbutrovich please take another look

Copy link
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

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

Minor nits, and then this is looking good! I'd be curious to revisit default values for nested types once this merges.

Copy link
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

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

Thanks @comphead, just a minor CI fix I think and then this is good to go!

@comphead comphead merged commit 8b3b77c into apache:main Aug 11, 2025
91 checks passed
// Nested literal support for native reader
// can be tracked https://github.com/apache/datafusion-comet/issues/1937
// now supports only Array of primitive
(Seq(CometConf.SCAN_NATIVE_ICEBERG_COMPAT, CometConf.SCAN_NATIVE_DATAFUSION)
Copy link
Member

Choose a reason for hiding this comment

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

Why is nested literal noly supported for native reader?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm working on this @wForget it works but has some issues with Spark 4.0 which I found in #2181
Hope it would be fixed soon

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.

feat: Support ARRAY literal
5 participants