Conversation
|
Thanks for this. Using the codegen dispatcher for A few things worth looking at: Rebase on Is the Overflow test. One small heads-up: the On benchmarks: since this runs in the JVM via dispatch rather than as a native Rust kernel, I do not think the usual native microbenchmark expectation applies here. |
|
@andygrove Thanks for the review! I've move the YearMonthIntervalType branch from |
|
Thanks for the rebase, this is much cleaner to review now, and the three points from last round are all addressed well. Moving the YM interval support into One thing before this is good to go: the Minor, non-blocking: a one-line comment in This review was prepared with the assistance of an LLM (Claude). |
|
@andygrove thanks for the review, addressed all of your suggestion! please take another look.
The
I adjust the note to say: "Calendar interval fallback to spark now" in
done. good catch! |
| case _: ByteType | _: ShortType | _: IntegerType | _: LongType | _: FloatType | | ||
| _: DoubleType | _: StringType | _: BinaryType | _: TimestampType | _: TimestampNTZType | | ||
| _: DecimalType | _: DateType | _: BooleanType | _: NullType | CalendarIntervalType => | ||
| _: DecimalType | _: DateType | _: BooleanType | _: NullType => |
There was a problem hiding this comment.
Moved CalendarIntervalType under CometLiteral#getSupportLevel
The expression wiring itself is straightforward and the SQL fixture covers a good range of multiplier types. Three things concern me, and two of them are about changes that are not in the description. Removing - _: DecimalType | _: DateType | _: BooleanType | _: NullType | CalendarIntervalType =>
+ _: DecimalType | _: DateType | _: BooleanType | _: NullType =>
This also collides with #5025, which is refactoring these predicates and relies on
case _ => supportedDataType(dt) || isTypeSupported(dt, "", ListBuffer.empty)Passing an empty name and a throwaway Duplicate work with #5161 Both this PR and #5161 add the same two arms to Two smaller notes
The description lists only |
…val expressions Restore CalendarIntervalType in QueryPlanSerde.supportedDataType (added deliberately by apache#4898; removing it narrowed hash, scalar-subquery, and nested-type gates out of scope for this PR) and revert CometSink to main, since its isTypeSupported OR existed only to patch sinks around that removal. CometLiteral now only adds YearMonthIntervalType alongside the existing DayTimeIntervalType arm. Move MultiplyYMInterval next to MultiplyDTInterval in the expression map's interval cluster. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@andygrove Thanks for the careful pass — pushed a2349c5 addressing it. Point by point: Removing Duplicate Expression map ordering — that section of the map is grouped by function family rather than alphabetically (e.g. Version coverage — ran |
# Conflicts: # docs/source/user-guide/latest/expressions.md # native/core/src/execution/planner.rs # spark/src/main/scala/org/apache/comet/serde/literals.scala
Merging upstream/main brought in `listLiteralElementSupported`, which `CometLiteralSuite` pins against `makeListLiteral`'s arms in both directions. This branch had already added a `YearMonthIntervalType` arm to the encoder, so after the merge the two sides disagreed and the pin failed. Widen the gate rather than drop the encoder arm: `serializeDataType` already maps the type and recurses through `ArrayType`, and `literal_to_array_ref` already reads the ints back as an `IntervalYearMonthArray`. An `array<interval year to month>` literal is now serialized directly instead of sending the whole projection back to Spark with "Unsupported data type ArrayType(YearMonthIntervalType(0,1),true)". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`abs.sql` pinned `SELECT abs(CAST(NULL AS INTERVAL YEAR TO MONTH))` as a fallback because CometLiteral did not admit YearMonthIntervalType literals, noting that it "flips to a failure when it is fixed". This branch adds that literal support, so the query now runs natively and the pinned fallback failed in every [expressions] CI job (Spark 3.4, 3.5, 4.0, 4.1, 4.2). Assert the answer and native operators instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Which issue does this PR close?
Close #3102.
Rationale for this change
This adds support for Spark's
multiply_ym_intervalexpression, allowing YearMonth interval multiplication to run through Comet instead of falling back toSpark.
What changes are included in this PR?
YearMonthIntervalTypeserialization to the Comet proto/native type mapping.MakeYMIntervalandMultiplyYMIntervalthrough the JVM codegen dispatcher.IntervalYearVectorinput/output support in the codegen kernel path.How are these changes tested?
cargo fmt./mvnw -Pspark-3.5 -Pscala-2.12 -DskipTests compilecargo +1.94.0 check -p datafusion-cometcargo +1.94.0 build./mvnw test -Pspark-3.5 -Pscala-2.12 -Dtest=none -Dsuites="org.apache.comet.CometSqlFileTestSuite multiply_ym_interval"