[bug](java-udf) fix java-udf not return const column when all args are const values (#23188)

eg: udf('asd'), this need return a const column, otherwise will be failed use the return column as other function params.

mysql> select concat('a', 'b', cuuid9('a'), ':c');
ERROR 1105 (HY000): errCode = 2, detailMessage = (10.16.10.6)[CANCELLED][INTERNAL_ERROR]const check failed, expr=VectorizedFn[VectorizedFnCallconcat]{
VLiteral (name = String, type = String, value = (a)),
VLiteral (name = String, type = String, value = (b)),
VectorizedFn[VectorizedFnCallcuuid9]
{ VLiteral (name = String, type = String, value = (a))},
VLiteral (name = String, type = String, value = (:c))}
This commit is contained in:
zhangstar333
2023-08-30 10:46:47 +08:00
committed by GitHub
parent 242e11aba1
commit 942a119881
2 changed files with 37 additions and 7 deletions

View File

@ -121,9 +121,9 @@ Status JavaFunctionCall::open(FunctionContext* context, FunctionContext::Functio
return Status::OK();
}
Status JavaFunctionCall::execute(FunctionContext* context, Block& block,
const ColumnNumbers& arguments, size_t result, size_t num_rows,
bool dry_run) {
Status JavaFunctionCall::execute_impl(FunctionContext* context, Block& block,
const ColumnNumbers& arguments, size_t result,
size_t num_rows) const {
JNIEnv* env = nullptr;
RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
JniContext* jni_ctx = reinterpret_cast<JniContext*>(