Skip to content

feat: support multiply_dt_interval#4900

Open
peterxcli wants to merge 2 commits into
apache:mainfrom
peterxcli:feat/multiply_dt_interval
Open

feat: support multiply_dt_interval#4900
peterxcli wants to merge 2 commits into
apache:mainfrom
peterxcli:feat/multiply_dt_interval

Conversation

@peterxcli

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes: #3101.

Rationale for this change

This adds support for Spark's multiply_dt_interval expression, allowing DayTime interval multiplication to execute within Comet through the JVM codegen dispatcher instead of falling back to Spark.

Using Spark's generated code preserves Spark-compatible rounding, null handling, and overflow behavior.

What changes are included in this PR?

  • Register MultiplyDTInterval with the JVM codegen dispatcher.
  • Add DayTimeIntervalType input support using Arrow DurationVector.
  • Add DayTime interval literal serialization as microsecond durations.
  • Support DayTime interval values in top-level and nested codegen inputs.
  • Update the expression support documentation.
  • Add SQL coverage for byte, short, integer, long, float, double, and decimal multipliers.
  • Cover interval literals, numeric operands on the left, nulls, half-up microsecond rounding, negative values, zero multiplication, and overflow.

How are these changes tested?

  • ./mvnw test -Pspark-3.5 -Pscala-2.12 -Dtest=none -Dsuites="org.apache.comet.CometSqlFileTestSuite multiply_dt_interval"

The focused SQL suite completed successfully with one test run and no failures.

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.

[Feature] Support Spark expression: multiply_dt_interval

1 participant