[Enhancement] support DATE and DATETIME types in Java UDF (backport #72337)#72362
Conversation
|
Cherry-pick of add5dee has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
|
|
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Hyper-FF <253014618+Hyper-FF@users.noreply.github.com> Signed-off-by: stdpain <drfeng08@gmail.com>
c3da023 to
da021cf
Compare
🌎 Translation Required?✅ All translation files are up to date.
|
Why I'm doing:
Map SQL DATE to java.time.LocalDate and DATETIME to java.time.LocalDateTime across the FE analyzer, the udf-extensions JNI runtime, and the BE Java function call path. Wire format mirrors the StarRocks column storage:
The batch path (input + output) zero-copies the column buffer through DirectByteBuffer; the per-row path (cast_to_jvalue / assign_jvalue / append_jvalue / check_type_matched) routes through new JVMFunctionHelper::newLocalDate{,Time} / valLocalDate{,Time} so const-column inputs and UDAF/UDTF returns also work.
Also wires DATE/DATETIME into the BE-side JNI signature parser (ClassAnalyzer::get_udaf_method_desc) and the GetColumnLogicalTypeVistor so ARRAY/ARRAY elements resolve correctly. The previous silent-skip on unrecognized object classes is hardened to a TYPE_UNKNOWN entry that surfaces a clear "unknown type sign" error from get_method_desc instead of segfaulting at method_desc[0].is_box.
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
https://claude.ai/code/session_013eanvS6pP87BHRE865hig8
This is an automatic backport of pull request #72337 done by Mergify.