feat: support interval codegen dispatch for nested values and native shuffle#4976
feat: support interval codegen dispatch for nested values and native shuffle#4976peterxcli wants to merge 4 commits into
Conversation
|
The array-of-interval and top-level native-shuffle cases are nice coverage. Since |
andygrove
left a comment
There was a problem hiding this comment.
Thanks for this. The interval plumbing is well scoped and the coverage looks good.
CI: The one red check (macOS [expressions]) is a transient infra flake, not a real failure. All 1167 tests passed and the build then died in the shade step resolving org.ow2.asm:asm with Unknown host repo.maven.apache.org. A re-run should clear it.
One cleanup I'd ask for before merge: in CometBatchKernelCodegenInput.scala, classOf[DurationVector] gets added twice even though it was already there in the base. It appears in the primitiveArrowClasses set (already at line 65, added again next to IntervalYearVector) and in the longCases collect (already present a few lines up, added again). The Set dedupes and the duplicate || is a no-op, so it is harmless, but it reads as a copy-paste slip. DayTimeIntervalType was already covered through those existing DurationVector entries, so I think only IntervalYearVector needs to stay and the two duplicate lines can be dropped. Was a different vector intended there?
On correctness: the mapping looks right. YearMonthIntervalType routes to getInt (Arrow Interval(YEAR_MONTH), int months) and DayTimeIntervalType to getLong (Arrow Duration(MICROSECOND), int64 micros), matching Utils.scala:161-164. Matching on _: YearMonthIntervalType / _: DayTimeIntervalType correctly covers all the start/end field variants since they share the same physical storage. The new recursive supportedSinkDataType never hands a complex type to the non-allowComplex base call, so it should be equivalent to the old check for non-interval nested types with intervals now allowed at the leaves.
Tests: glad to see the struct and map cases added. One small thing: the null interval is only exercised in the array case. Would it be worth adding a null interval at the top level, and in a struct field and map value, so the native-shuffle path sees nulls too?
Nice work.
Which issue does this PR close?
Closes #4975.
Rationale for this change
YearMonthIntervalTypeandDayTimeIntervalTypevalues fall back to Spark when they cross codegen boundaries as nested values or native-shuffle payloads because their Arrow vectors and getter paths are not dispatched.What changes are included in this PR?
How are these changes tested?
make coreCometSqlFileTestSuite make_ym_intervalon Spark 4.1 and Spark 3.5CometSqlFileTestSuite make_dt_intervalon Spark 4.1 and Spark 3.5git diff --check