Skip to content

chore: Refactor GetArrayItem, ElementAt, GetArrayStructFields out of QueryPlanSerde #2026

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

petern48
Copy link
Contributor

Which issue does this PR close?

Part of #2019

Rationale for this change

See #2019

What changes are included in this PR?

Refactor GetArrayItem, ElementAt, GetArrayStructFields out of QueryPlanSerde

How are these changes tested?

No new tests are needed since this is a refactor

@petern48 petern48 changed the title refactor: Refactor GetArrayItem, ElementAt, GetArrayStructFields out of QueryPlanSerde chore: Refactor GetArrayItem, ElementAt, GetArrayStructFields out of QueryPlanSerde Jul 12, 2025
@petern48 petern48 marked this pull request as ready for review July 12, 2025 17:48
Comment on lines 1861 to 1878
case _ @ArrayFilter(_, func) if func.children.head.isInstanceOf[IsNotNull] =>
convert(CometArrayCompact)
case _: ArrayExcept =>
convert(CometArrayExcept)
case Rand(child, _) =>
createUnaryExpr(
expr,
child,
inputs,
binding,
(builder, unaryExpr) => builder.setRand(unaryExpr))
case expr =>
QueryPlanSerde.exprSerdeMap.get(expr.getClass) match {
case Some(handler) => convert(handler)
case _ =>
withInfo(expr, s"${expr.prettyName} is not supported", expr.children: _*)
None
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this section should be deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're definitely right. Sorry, I think I (incorrectly) assumed I was working at the bottom of the list and deleted those without realizing.

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.

LGTM pending CI. Thanks @petern48

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2025

Codecov Report

Attention: Patch coverage is 10.52632% with 51 lines in your changes missing coverage. Please review.

Project coverage is 38.84%. Comparing base (f09f8af) to head (091732c).
Report is 326 commits behind head on main.

Files with missing lines Patch % Lines
...src/main/scala/org/apache/comet/serde/arrays.scala 5.55% 51 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #2026       +/-   ##
=============================================
- Coverage     56.12%   38.84%   -17.28%     
+ Complexity      976      887       -89     
=============================================
  Files           119      134       +15     
  Lines         11743    13046     +1303     
  Branches       2251     2385      +134     
=============================================
- Hits           6591     5068     -1523     
- Misses         4012     6996     +2984     
+ Partials       1140      982      -158     

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

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