Skip to content

Conversation

@hubgeter
Copy link
Contributor

@hubgeter hubgeter commented Oct 9, 2025

What problem does this PR solve?

Problem Summary:

This PR significantly refactors the JNI util class.
It introduces a safer way to operate JNI, including automatic reference deletion and exception checking...

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hubgeter
Copy link
Contributor Author

hubgeter commented Oct 9, 2025

run buildall

@hubgeter hubgeter force-pushed the jni_util_factor branch 2 times, most recently from 39b5627 to 0f97a59 Compare October 9, 2025 15:24
@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.45% (5/1111) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.39% (17713/33807)
Line Coverage 37.66% (160775/426904)
Region Coverage 32.11% (122823/382526)
Branch Coverage 33.53% (53849/160578)

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

ClickBench: Total hot run time: 30.94 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 8d0250751c62577af1a56aadbda26ca9dd11a10b, data reload: false

query1	0.06	0.05	0.05
query2	0.10	0.05	0.06
query3	0.26	0.08	0.08
query4	1.60	0.12	0.12
query5	0.28	0.26	0.25
query6	1.19	0.66	0.66
query7	0.04	0.03	0.03
query8	0.06	0.04	0.04
query9	0.62	0.56	0.52
query10	0.57	0.57	0.57
query11	0.17	0.11	0.12
query12	0.15	0.12	0.12
query13	0.63	0.61	0.62
query14	1.06	1.04	1.05
query15	0.87	0.86	0.88
query16	0.44	0.40	0.41
query17	1.06	1.08	1.10
query18	0.22	0.20	0.20
query19	2.01	1.87	1.88
query20	0.02	0.01	0.01
query21	15.42	0.94	0.57
query22	0.76	1.20	0.75
query23	14.83	1.41	0.64
query24	6.96	0.98	1.01
query25	0.53	0.29	0.14
query26	0.67	0.16	0.14
query27	0.07	0.06	0.06
query28	9.39	1.38	0.96
query29	12.56	3.97	3.24
query30	0.29	0.14	0.11
query31	2.82	0.58	0.39
query32	3.24	0.57	0.49
query33	3.15	3.14	3.15
query34	16.10	5.51	4.86
query35	4.97	4.90	4.96
query36	0.71	0.51	0.50
query37	0.11	0.08	0.07
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.17	0.18	0.16
query41	0.08	0.04	0.04
query42	0.04	0.04	0.03
query43	0.05	0.04	0.03
Total cold run time: 104.43 s
Total hot run time: 30.94 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.54% (6/1112) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.41% (17722/33811)
Line Coverage 37.68% (160885/426934)
Region Coverage 32.13% (122907/382567)
Branch Coverage 33.55% (53884/160591)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 62.51% (697/1115) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.07% (23544/33129)
Line Coverage 57.46% (245072/426505)
Region Coverage 52.56% (203630/387395)
Branch Coverage 54.32% (87666/161402)

@morningman morningman requested a review from Copilot November 4, 2025 10:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the JNI utility code in Apache Doris, introducing a new type-safe C++ wrapper API around JNI operations. The changes replace raw JNI API calls with a templated, RAII-based approach using Jni::Object, Jni::Class, Jni::String, and Jni::Array template classes.

Key changes:

  • New JNI wrapper framework with automatic reference management (Local vs Global refs)
  • Replaces raw jobject, jclass, jmethodID with type-safe wrappers
  • Adds comprehensive test suite for JNI utility functions
  • Updates all existing JNI call sites across the codebase to use new API

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
be/src/util/jni-util.h Major refactor introducing templated JNI wrapper classes with RAII semantics
be/src/util/jni-util.cpp Implementation of new JNI utilities and namespace reorganization
be/test/util/jni_util_test.cpp New comprehensive test suite for JNI operations
be/src/vec/exec/vjdbc_connector.cpp Migration from raw JNI to new wrapper API
be/src/vec/exec/jni_connector.cpp Migration from raw JNI to new wrapper API
be/src/vec/functions/function_java_udf.cpp Migration from raw JNI to new wrapper API
be/src/util/jvm_metrics.cpp Migration from raw JNI to new wrapper API
be/src/service/doris_main.cpp Update to new namespace Jni::Util::Init()
Comments suppressed due to low confidence (1)

be/src/vec/exec/vjdbc_connector.cpp:1

  • Commented-out old code at lines 110, 275 should be removed.
// Licensed to the Apache Software Foundation (ASF) under one

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ASSERT_STREQ(buf2.get(), "hello");
}

// 6. substring() 测试
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chinese comment in English codebase. Should be: '// 6. substring() test'

Suggested change
// 6. substring() 测试
// 6. substring() test

Copilot uses AI. Check for mistakes.
Comment on lines 83 to 95
// RETURN_IF_ERROR
RETURN_IF_ERROR(
_executor_obj.call_nonvirtual_void_method(env, _executor_clazz, _executor_close_id)
.call());

// env->CallNonvirtualVoidMethod(_executor_obj, _executor_clazz, _executor_close_id); todo
// RETURN_ERROR_IF_EXC(env);
// env->DeleteGlobalRef(_executor_factory_clazz);
// RETURN_ERROR_IF_EXC(env);
// env->DeleteGlobalRef(_executor_clazz);
// RETURN_IF_ERROR(JniUtil::GetJniExceptionMsg(env));
// env->DeleteGlobalRef(_executor_obj);
// RETURN_ERROR_IF_EXC(env);
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out old code should be removed. These lines are unnecessary and reduce code clarity.

Suggested change
// RETURN_IF_ERROR
RETURN_IF_ERROR(
_executor_obj.call_nonvirtual_void_method(env, _executor_clazz, _executor_close_id)
.call());
// env->CallNonvirtualVoidMethod(_executor_obj, _executor_clazz, _executor_close_id); todo
// RETURN_ERROR_IF_EXC(env);
// env->DeleteGlobalRef(_executor_factory_clazz);
// RETURN_ERROR_IF_EXC(env);
// env->DeleteGlobalRef(_executor_clazz);
// RETURN_IF_ERROR(JniUtil::GetJniExceptionMsg(env));
// env->DeleteGlobalRef(_executor_obj);
// RETURN_ERROR_IF_EXC(env);
RETURN_IF_ERROR(
_executor_obj.call_nonvirtual_void_method(env, _executor_clazz, _executor_close_id)
.call());

Copilot uses AI. Check for mistakes.
, _executor_factory_ctor_id, env,
GetStaticMethodID(_executor_factory_clazz, "getExecutorClass",
"(Lorg/apache/doris/thrift/TOdbcTableType;)Ljava/lang/String;"));
// todo xxx
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete TODO comment. Either complete the TODO or remove it if not needed.

Suggested change
// todo xxx

Copilot uses AI. Check for mistakes.
&_executor_factory_clazz));

jobject jtable_type = nullptr;
RETURN_IF_ERROR(_get_java_table_type(env, _conn_param.table_type, &jtable_type));
RETURN_IF_ERROR(_executor_factory_clazz.get_static_method(
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out old code at lines 187-189 and 203-205 should be removed to improve code readability.

Copilot uses AI. Check for mistakes.
env->DeleteLocalRef(java_enum_local_obj);
return Status::OK();
Jni::LocalObject* java_enum_obj) {
Jni::LocalClass enum_class; // todo global
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete TODO comment. If enum_class should be Global instead of Local, either fix it or provide more context about why it remains Local.

Suggested change
Jni::LocalClass enum_class; // todo global
Jni::LocalClass enum_class; // Local reference is sufficient as enum_class is only used within this method.

Copilot uses AI. Check for mistakes.

jobject input_map = nullptr;
RETURN_IF_ERROR(JniUtil::convert_to_java_map(env, input_params, &input_map));
// jobject input_map = nullptr;
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out old code should be removed for cleaner codebase.

Suggested change
// jobject input_map = nullptr;

Copilot uses AI. Check for mistakes.
Comment on lines 401 to 402
// auto = (jlongArray)threadIdsObject;
// Jni::LocalArray threadIds;
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out old code at lines 401-402, 414-416 should be removed.

Copilot uses AI. Check for mistakes.

//IsSameObject not throw exception
if (env->IsSameObject(threadState, _newThreadStateObj)) {
//IsSameObject not throw exception todo ??
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear TODO comment. Clarify what needs to be verified about IsSameObject exception behavior or remove if confirmed.

Suggested change
//IsSameObject not throw exception todo ??

Copilot uses AI. Check for mistakes.
const char* gcNameStr = env->GetStringUTFChars((jstring)gcName, NULL);
if (gcNameStr != nullptr) {
if (strcmp(gcNameStr, "G1 Young Generation") == 0) {
if (gcNameStr.get() != nullptr) { // todo nulllptr in get_string_chars ??
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: 'nulllptr' should be 'nullptr'. Also, clarify the TODO about when get_string_chars might return nullptr.

Suggested change
if (gcNameStr.get() != nullptr) { // todo nulllptr in get_string_chars ??
if (gcNameStr.get() != nullptr) { // TODO: get_string_chars may return nullptr if the Java string is null or if a JNI error occurs.

Copilot uses AI. Check for mistakes.
@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34345 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit c33c84019e44972071d162da49f58372e62f2003, data reload: false

------ Round 1 ----------------------------------
q1	17598	5225	5064	5064
q2	2009	369	210	210
q3	10218	1304	721	721
q4	10237	971	377	377
q5	7557	2363	2419	2363
q6	185	173	135	135
q7	911	766	608	608
q8	9344	1395	1154	1154
q9	7085	5238	5136	5136
q10	6916	2237	1837	1837
q11	504	298	282	282
q12	358	363	220	220
q13	17806	3668	3034	3034
q14	240	250	218	218
q15	598	517	509	509
q16	1055	1010	947	947
q17	617	890	353	353
q18	7666	7281	7093	7093
q19	1098	963	566	566
q20	359	344	225	225
q21	3870	3160	2301	2301
q22	1047	1046	992	992
Total cold run time: 107278 ms
Total hot run time: 34345 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5315	5126	5114	5114
q2	252	324	223	223
q3	2171	2666	2330	2330
q4	1324	1759	1333	1333
q5	4201	4655	4611	4611
q6	213	174	127	127
q7	2085	1956	1890	1890
q8	2691	2617	2651	2617
q9	7430	7445	7520	7445
q10	3035	3302	2826	2826
q11	596	540	529	529
q12	711	779	633	633
q13	3621	3899	3382	3382
q14	278	309	290	290
q15	590	556	528	528
q16	1095	1111	1071	1071
q17	1163	1628	1378	1378
q18	7883	7832	7527	7527
q19	795	825	871	825
q20	1997	2085	1930	1930
q21	5040	4660	4424	4424
q22	1095	1032	1002	1002
Total cold run time: 53581 ms
Total hot run time: 52035 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188583 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit c33c84019e44972071d162da49f58372e62f2003, data reload: false

query1	1059	406	402	402
query2	6609	1670	1754	1670
query3	6751	226	224	224
query4	26594	23849	23676	23676
query5	4388	619	470	470
query6	319	232	219	219
query7	4657	499	298	298
query8	303	260	238	238
query9	8708	2609	2609	2609
query10	507	352	287	287
query11	15737	15039	14972	14972
query12	179	125	116	116
query13	1690	569	457	457
query14	10385	9195	9209	9195
query15	199	193	183	183
query16	7176	701	524	524
query17	999	780	653	653
query18	1996	432	330	330
query19	215	209	181	181
query20	140	128	125	125
query21	216	136	120	120
query22	3950	4318	4028	4028
query23	34204	33023	33416	33023
query24	8439	2418	2418	2418
query25	624	552	485	485
query26	1262	288	170	170
query27	2724	501	359	359
query28	4370	2219	2196	2196
query29	865	653	537	537
query30	314	230	200	200
query31	921	831	755	755
query32	84	78	76	76
query33	636	386	334	334
query34	789	902	525	525
query35	853	863	744	744
query36	960	991	911	911
query37	127	119	86	86
query38	3538	3594	3470	3470
query39	1474	1422	1422	1422
query40	222	127	121	121
query41	61	60	60	60
query42	130	115	110	110
query43	480	498	444	444
query44	1230	742	731	731
query45	186	178	173	173
query46	883	989	638	638
query47	1786	1826	1710	1710
query48	391	454	330	330
query49	772	532	413	413
query50	633	678	403	403
query51	3941	3908	3887	3887
query52	112	112	102	102
query53	241	276	193	193
query54	313	288	284	284
query55	87	89	88	88
query56	308	309	310	309
query57	1184	1190	1111	1111
query58	281	275	274	274
query59	2573	2663	2510	2510
query60	392	348	328	328
query61	166	162	179	162
query62	809	725	701	701
query63	235	189	196	189
query64	4532	1159	865	865
query65	4032	3965	3952	3952
query66	1167	437	333	333
query67	15372	15332	14977	14977
query68	8395	921	598	598
query69	492	321	283	283
query70	1330	1287	1274	1274
query71	483	361	314	314
query72	5885	4954	4960	4954
query73	717	582	362	362
query74	8822	8892	8853	8853
query75	3911	3316	2827	2827
query76	3718	1166	752	752
query77	825	399	311	311
query78	9580	9676	8844	8844
query79	2750	829	600	600
query80	713	576	508	508
query81	491	270	236	236
query82	430	162	137	137
query83	321	274	257	257
query84	305	108	102	102
query85	889	498	446	446
query86	339	309	291	291
query87	3725	3701	3637	3637
query88	2863	2296	2245	2245
query89	436	335	307	307
query90	2103	227	221	221
query91	171	168	134	134
query92	82	70	64	64
query93	2167	969	641	641
query94	707	445	330	330
query95	410	327	323	323
query96	496	575	286	286
query97	2935	2945	2865	2865
query98	230	221	211	211
query99	1471	1462	1284	1284
Total cold run time: 275672 ms
Total hot run time: 188583 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.81 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit c33c84019e44972071d162da49f58372e62f2003, data reload: false

query1	0.05	0.05	0.06
query2	0.09	0.06	0.05
query3	0.25	0.08	0.08
query4	1.60	0.12	0.12
query5	0.27	0.26	0.26
query6	1.15	0.64	0.65
query7	0.03	0.03	0.03
query8	0.05	0.05	0.04
query9	0.60	0.53	0.53
query10	0.58	0.57	0.58
query11	0.17	0.12	0.12
query12	0.16	0.12	0.13
query13	0.63	0.60	0.60
query14	1.00	1.01	1.00
query15	0.84	0.84	0.85
query16	0.38	0.39	0.39
query17	1.01	1.02	1.06
query18	0.21	0.19	0.20
query19	1.93	1.75	1.75
query20	0.02	0.01	0.01
query21	15.49	0.18	0.13
query22	5.04	0.07	0.05
query23	15.66	0.27	0.10
query24	2.30	0.79	0.86
query25	0.08	0.07	0.08
query26	0.14	0.12	0.14
query27	0.07	0.06	0.06
query28	4.83	1.16	0.93
query29	12.62	3.94	3.23
query30	0.29	0.14	0.11
query31	2.82	0.59	0.38
query32	3.23	0.56	0.47
query33	3.06	3.00	3.05
query34	15.91	5.14	4.56
query35	4.61	4.63	4.57
query36	0.66	0.50	0.49
query37	0.10	0.07	0.06
query38	0.06	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 98.36 s
Total hot run time: 27.81 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.54% (6/1112) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.69% (18230/34601)
Line Coverage 38.13% (165771/434760)
Region Coverage 33.11% (129059/389771)
Branch Coverage 33.86% (55324/163371)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 62.51% (697/1115) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.49% (24319/34015)
Line Coverage 57.96% (252405/435479)
Region Coverage 53.19% (210270/395292)
Branch Coverage 54.56% (89718/164454)

JNIEnv* env = nullptr;
RETURN_IF_ERROR(Jni::Env::Get(&env));

if (env == nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems have checked in Get() function

}
return Status::JniError("Failed to create global reference to JniUtil class.");
}
env->DeleteLocalRef(local_jni_util_cl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems before L95, also need delete local ref

IntMethod,
LongMethod,
VoidMethod,
BooleanMethod,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jboolean z;
jbyte    b;
jchar    c;
jshort   s;
jint     i;
jlong    j;
jfloat   f;
jdouble  d;
jobject  l;

those all of types, maybe could add those type once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the additions so far are sufficient for the vast majority of scenarios, and there's no need to add other tag that's never been used.

} else if constexpr (std::is_same_v<return_type, jobject>) {
jobject tmp = CallHelper<tag>::call_impl(_env, _base, _method, _args.data());
RETURN_ERROR_IF_EXC(_env);
_env->DeleteLocalRef(tmp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe could call delete first
_env->DeleteLocalRef(tmp);
RETURN_ERROR_IF_EXC(_env);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

template <CallTag tag>
friend class NonvirtaulFunctionCall;

~Object() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here do we need add virtual key word?

JNIEnv* env = nullptr;
if (Status st = RefHelper<Ref>::get_env(&env); !st.ok()) [[unlikely]] {
LOG(WARNING) << "Can't destroy Jni Ref : " << st.msg();
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here if return directly, and no call destroy fucntion,
the ref seems will be leak?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because destroy requires an environment variable (env). However, this situation is unlikely to occur, as the environment variable is used when the object is created.

};

template <CallTag tag>
class NonvirtaulFunctionCall : public FunctionCall<tag> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class NonvirtaulFunctionCall : public FunctionCall<tag> {
class NonvirtualFunctionCall : public FunctionCall<tag> {

@morningman
Copy link
Contributor

run buildall

1 similar comment
@morningman
Copy link
Contributor

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 36639 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit a6c32ae60a4bf307326fba9faaca8254b5d35873, data reload: false

------ Round 1 ----------------------------------
q1	17624	4214	4072	4072
q2	2041	355	239	239
q3	10194	1343	744	744
q4	10226	903	325	325
q5	7559	2118	1972	1972
q6	193	172	136	136
q7	1001	856	718	718
q8	9364	1503	1164	1164
q9	7180	5395	5318	5318
q10	6863	2425	1964	1964
q11	538	328	305	305
q12	672	738	579	579
q13	17794	3716	3038	3038
q14	295	319	276	276
q15	596	530	517	517
q16	707	686	634	634
q17	703	800	572	572
q18	7876	7892	7952	7892
q19	1227	1036	674	674
q20	437	370	256	256
q21	4809	4226	4331	4226
q22	1079	1094	1018	1018
Total cold run time: 108978 ms
Total hot run time: 36639 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4229	4301	4340	4301
q2	335	422	320	320
q3	2379	2790	2446	2446
q4	1443	1872	1412	1412
q5	4540	4516	4677	4516
q6	211	166	125	125
q7	2008	2038	1830	1830
q8	2697	2527	2494	2494
q9	7567	7398	7458	7398
q10	3085	3380	2845	2845
q11	587	523	503	503
q12	648	739	531	531
q13	3255	3679	3059	3059
q14	270	280	260	260
q15	536	491	491	491
q16	616	660	594	594
q17	1126	1403	1394	1394
q18	7365	7143	7051	7051
q19	842	808	845	808
q20	1920	1963	1795	1795
q21	4680	4308	4169	4169
q22	1112	1052	978	978
Total cold run time: 51451 ms
Total hot run time: 49320 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 178725 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit a6c32ae60a4bf307326fba9faaca8254b5d35873, data reload: false

query5	5490	617	491	491
query6	348	235	219	219
query7	4221	478	265	265
query8	297	233	264	233
query9	8773	2583	2577	2577
query10	563	368	325	325
query11	15337	15079	14512	14512
query12	182	117	114	114
query13	1268	503	404	404
query14	6975	3257	2998	2998
query14_1	2909	2929	2983	2929
query15	219	199	181	181
query16	868	495	456	456
query17	1155	729	592	592
query18	2700	438	336	336
query19	229	228	202	202
query20	123	116	107	107
query21	226	144	115	115
query22	3843	4063	3882	3882
query23	16711	16179	16102	16102
query23_1	16039	16157	16189	16157
query24	7212	1617	1222	1222
query24_1	1235	1241	1247	1241
query25	561	469	421	421
query26	1243	268	157	157
query27	2756	464	309	309
query28	4501	2166	2158	2158
query29	796	546	441	441
query30	320	251	215	215
query31	823	729	616	616
query32	80	74	69	69
query33	561	347	294	294
query34	922	891	547	547
query35	774	814	733	733
query36	862	920	827	827
query37	136	94	76	76
query38	2861	2877	2878	2877
query39	774	753	737	737
query39_1	687	691	699	691
query40	229	134	128	128
query41	69	66	62	62
query42	109	107	109	107
query43	454	460	403	403
query44	1333	749	743	743
query45	200	192	183	183
query46	887	1035	610	610
query47	1646	1712	1578	1578
query48	324	334	243	243
query49	638	433	346	346
query50	688	293	238	238
query51	3814	3855	3834	3834
query52	102	111	99	99
query53	324	344	291	291
query54	299	265	263	263
query55	84	78	73	73
query56	304	317	302	302
query57	1176	1138	1073	1073
query58	281	257	252	252
query59	2353	2503	2391	2391
query60	314	317	292	292
query61	190	174	183	174
query62	704	685	637	637
query63	333	297	305	297
query64	5077	1412	1127	1127
query65	4022	3935	3991	3935
query66	1384	462	349	349
query67	15350	14911	14794	14794
query68	5672	1015	732	732
query69	514	363	323	323
query70	1080	1023	971	971
query71	402	322	298	298
query72	6264	5009	5122	5009
query73	727	656	318	318
query74	8740	8840	8628	8628
query75	3222	3125	2780	2780
query76	3838	1138	748	748
query77	525	406	296	296
query78	9578	9818	8773	8773
query79	1261	861	597	597
query80	1446	626	540	540
query81	547	266	241	241
query82	622	132	105	105
query83	280	248	236	236
query84	257	126	101	101
query85	921	509	456	456
query86	409	287	311	287
query87	3006	3114	3004	3004
query88	3231	2268	2239	2239
query89	448	458	393	393
query90	1910	165	167	165
query91	176	170	155	155
query92	75	69	63	63
query93	1098	894	561	561
query94	560	281	288	281
query95	554	319	369	319
query96	591	465	206	206
query97	2281	2345	2215	2215
query98	223	193	192	192
query99	1263	1324	1186	1186
Total cold run time: 260376 ms
Total hot run time: 178725 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.45 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a6c32ae60a4bf307326fba9faaca8254b5d35873, data reload: false

query1	0.05	0.05	0.05
query2	0.09	0.04	0.04
query3	0.25	0.08	0.09
query4	1.61	0.11	0.12
query5	0.30	0.25	0.26
query6	1.17	0.64	0.63
query7	0.03	0.02	0.02
query8	0.05	0.04	0.05
query9	0.57	0.51	0.50
query10	0.56	0.56	0.57
query11	0.15	0.11	0.10
query12	0.15	0.11	0.12
query13	0.61	0.60	0.61
query14	0.99	0.99	0.98
query15	0.80	0.79	0.82
query16	0.38	0.41	0.39
query17	1.00	1.04	1.04
query18	0.24	0.21	0.20
query19	1.95	1.89	1.85
query20	0.02	0.01	0.02
query21	15.46	0.28	0.14
query22	4.84	0.05	0.05
query23	16.09	0.27	0.10
query24	1.05	0.39	1.14
query25	0.11	0.09	0.05
query26	0.14	0.14	0.14
query27	0.08	0.08	0.06
query28	5.51	1.21	1.02
query29	12.59	4.01	3.20
query30	0.28	0.14	0.13
query31	2.81	0.64	0.41
query32	3.23	0.55	0.47
query33	2.97	3.05	3.10
query34	16.95	5.17	4.51
query35	4.57	4.54	4.59
query36	0.65	0.50	0.49
query37	0.11	0.07	0.06
query38	0.07	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.08	0.03	0.03
query42	0.05	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 98.86 s
Total hot run time: 27.45 s

Copy link
Contributor Author

@hubgeter hubgeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run buildall

IntMethod,
LongMethod,
VoidMethod,
BooleanMethod,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the additions so far are sufficient for the vast majority of scenarios, and there's no need to add other tag that's never been used.

} else if constexpr (std::is_same_v<return_type, jobject>) {
jobject tmp = CallHelper<tag>::call_impl(_env, _base, _method, _args.data());
RETURN_ERROR_IF_EXC(_env);
_env->DeleteLocalRef(tmp);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

JNIEnv* env = nullptr;
if (Status st = RefHelper<Ref>::get_env(&env); !st.ok()) [[unlikely]] {
LOG(WARNING) << "Can't destroy Jni Ref : " << st.msg();
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because destroy requires an environment variable (env). However, this situation is unlikely to occur, as the environment variable is used when the object is created.

@hubgeter
Copy link
Contributor Author

run buildall

@morningman
Copy link
Contributor

run buildall

@morningman
Copy link
Contributor

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 35564 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 1e80f87866bc03fb7301892102acfb3e4ae9aa6e, data reload: false

------ Round 1 ----------------------------------
q1	17613	4161	4065	4065
q2	1990	351	231	231
q3	10209	1288	732	732
q4	10212	871	324	324
q5	7854	2155	1916	1916
q6	223	170	139	139
q7	976	793	661	661
q8	9287	1373	1094	1094
q9	7054	5181	5219	5181
q10	6840	1806	1422	1422
q11	507	302	291	291
q12	766	735	570	570
q13	17781	3839	3048	3048
q14	298	292	275	275
q15	595	517	501	501
q16	703	682	632	632
q17	721	775	592	592
q18	7650	7753	7963	7753
q19	1161	994	634	634
q20	435	397	261	261
q21	4524	4171	4177	4171
q22	1171	1128	1071	1071
Total cold run time: 108570 ms
Total hot run time: 35564 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4309	4202	4154	4154
q2	330	374	336	336
q3	2391	2872	2377	2377
q4	1434	1861	1430	1430
q5	4431	4378	4256	4256
q6	217	167	128	128
q7	1983	1964	1797	1797
q8	2515	2370	2320	2320
q9	7188	7006	6661	6661
q10	2279	2504	2087	2087
q11	527	456	440	440
q12	652	676	562	562
q13	3351	3792	3061	3061
q14	263	290	260	260
q15	524	483	477	477
q16	604	651	605	605
q17	1094	1219	1321	1219
q18	7387	7388	7339	7339
q19	840	828	848	828
q20	1907	1958	1809	1809
q21	4598	4232	4188	4188
q22	1068	1024	1011	1011
Total cold run time: 49892 ms
Total hot run time: 47345 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173805 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 1e80f87866bc03fb7301892102acfb3e4ae9aa6e, data reload: false

query5	4837	568	410	410
query6	325	221	211	211
query7	4246	457	273	273
query8	341	238	230	230
query9	8741	2615	2587	2587
query10	518	356	330	330
query11	15224	15115	14750	14750
query12	168	118	111	111
query13	1267	490	378	378
query14	6225	2951	2734	2734
query14_1	2636	2609	2858	2609
query15	204	197	174	174
query16	990	467	469	467
query17	1072	689	582	582
query18	2473	444	350	350
query19	228	227	197	197
query20	121	115	115	115
query21	214	146	126	126
query22	3907	3930	3891	3891
query23	16008	15795	15290	15290
query23_1	15425	15392	15463	15392
query24	7443	1594	1176	1176
query24_1	1224	1210	1227	1210
query25	569	484	419	419
query26	1230	268	159	159
query27	2787	457	301	301
query28	4508	2197	2184	2184
query29	830	576	452	452
query30	328	241	211	211
query31	802	638	545	545
query32	82	76	69	69
query33	543	333	297	297
query34	879	901	528	528
query35	756	817	703	703
query36	866	887	870	870
query37	129	94	73	73
query38	2744	2724	2634	2634
query39	778	756	730	730
query39_1	713	716	702	702
query40	212	131	110	110
query41	66	62	63	62
query42	101	99	98	98
query43	429	468	421	421
query44	1329	743	767	743
query45	186	182	177	177
query46	862	1013	612	612
query47	1465	1478	1387	1387
query48	324	321	250	250
query49	592	427	317	317
query50	634	279	201	201
query51	3786	3781	3796	3781
query52	103	109	94	94
query53	285	329	274	274
query54	274	254	240	240
query55	74	72	75	72
query56	277	288	275	275
query57	1008	1021	890	890
query58	257	241	254	241
query59	1992	2145	1995	1995
query60	314	313	288	288
query61	159	186	152	152
query62	401	391	327	327
query63	305	274	280	274
query64	5063	1280	975	975
query65	3825	3705	3722	3705
query66	1423	422	306	306
query67	14859	15168	14812	14812
query68	8237	1002	732	732
query69	484	340	301	301
query70	1063	969	951	951
query71	369	295	268	268
query72	6257	4741	5012	4741
query73	702	613	314	314
query74	8791	8721	8497	8497
query75	2914	2889	2495	2495
query76	3929	1049	657	657
query77	478	370	282	282
query78	9714	9871	9216	9216
query79	1496	915	606	606
query80	668	593	478	478
query81	497	264	231	231
query82	205	144	116	116
query83	262	251	241	241
query84	269	116	100	100
query85	901	509	446	446
query86	386	324	328	324
query87	2867	2836	2772	2772
query88	3220	2278	2285	2278
query89	398	340	324	324
query90	2184	150	140	140
query91	168	158	140	140
query92	80	70	61	61
query93	1310	914	564	564
query94	581	330	295	295
query95	565	332	357	332
query96	587	452	210	210
query97	2308	2373	2283	2283
query98	228	197	200	197
query99	578	606	504	504
Total cold run time: 254621 ms
Total hot run time: 173805 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.12 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 1e80f87866bc03fb7301892102acfb3e4ae9aa6e, data reload: false

query1	0.06	0.05	0.04
query2	0.10	0.05	0.04
query3	0.25	0.08	0.08
query4	1.61	0.12	0.11
query5	0.27	0.26	0.24
query6	1.15	0.65	0.65
query7	0.04	0.02	0.02
query8	0.05	0.04	0.04
query9	0.59	0.51	0.51
query10	0.55	0.54	0.55
query11	0.15	0.12	0.11
query12	0.16	0.13	0.14
query13	0.62	0.60	0.59
query14	0.97	0.99	0.97
query15	0.82	0.80	0.82
query16	0.40	0.40	0.40
query17	1.03	1.03	1.07
query18	0.23	0.22	0.21
query19	1.93	1.88	1.85
query20	0.02	0.01	0.01
query21	15.44	0.29	0.13
query22	4.82	0.04	0.04
query23	15.97	0.28	0.11
query24	1.47	0.35	0.79
query25	0.10	0.06	0.08
query26	0.14	0.14	0.14
query27	0.06	0.06	0.04
query28	5.03	1.05	0.88
query29	12.61	4.01	3.27
query30	0.28	0.14	0.11
query31	2.82	0.62	0.38
query32	3.23	0.56	0.49
query33	2.99	2.97	2.99
query34	16.71	5.12	4.46
query35	4.46	4.53	4.48
query36	0.66	0.50	0.49
query37	0.10	0.06	0.06
query38	0.07	0.04	0.04
query39	0.05	0.03	0.03
query40	0.16	0.14	0.13
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 98.34 s
Total hot run time: 27.12 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.54% (6/1110) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.33% (18967/35568)
Line Coverage 39.29% (175909/447728)
Region Coverage 33.79% (136089/402724)
Branch Coverage 34.77% (58766/169023)

@morningman
Copy link
Contributor

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 35726 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit c755d684fcc099b3091df3c0f4cd3ea806b64fc5, data reload: false

------ Round 1 ----------------------------------
q1	17588	4288	4054	4054
q2	2016	368	244	244
q3	10283	1290	729	729
q4	10309	817	311	311
q5	9038	2165	1917	1917
q6	214	175	136	136
q7	939	822	672	672
q8	9275	1437	1124	1124
q9	6915	5208	5202	5202
q10	6833	1848	1412	1412
q11	495	308	288	288
q12	728	733	576	576
q13	17795	3837	3111	3111
q14	303	296	275	275
q15	598	504	501	501
q16	715	686	625	625
q17	737	795	608	608
q18	8023	8006	8112	8006
q19	1548	1031	630	630
q20	450	390	270	270
q21	4598	4256	4006	4006
q22	1172	1166	1029	1029
Total cold run time: 110572 ms
Total hot run time: 35726 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4431	4193	4171	4171
q2	351	404	322	322
q3	2362	2812	2445	2445
q4	1381	1889	1406	1406
q5	4613	4296	4370	4296
q6	238	164	125	125
q7	1918	1872	1934	1872
q8	2525	2330	2314	2314
q9	7160	7097	7411	7097
q10	2397	2740	2234	2234
q11	558	473	461	461
q12	674	746	585	585
q13	3367	3760	3068	3068
q14	267	282	263	263
q15	520	492	482	482
q16	637	654	605	605
q17	1106	1323	1370	1323
q18	7350	7313	7326	7313
q19	848	847	866	847
q20	1894	1967	1795	1795
q21	4502	4274	4176	4176
q22	1104	1067	1016	1016
Total cold run time: 50203 ms
Total hot run time: 48216 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 175623 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit c755d684fcc099b3091df3c0f4cd3ea806b64fc5, data reload: false

query5	4531	576	440	440
query6	321	223	209	209
query7	4204	469	265	265
query8	327	254	251	251
query9	8782	2593	2636	2593
query10	483	362	309	309
query11	15194	15118	14914	14914
query12	164	116	112	112
query13	1241	469	377	377
query14	6038	2990	2700	2700
query14_1	2607	2584	2579	2579
query15	205	196	182	182
query16	987	475	457	457
query17	1113	699	616	616
query18	2451	423	330	330
query19	225	215	189	189
query20	130	116	115	115
query21	217	137	113	113
query22	4038	4042	3988	3988
query23	16074	15613	15429	15429
query23_1	15506	15653	15454	15454
query24	7370	1577	1211	1211
query24_1	1222	1177	1227	1177
query25	533	452	400	400
query26	1229	261	161	161
query27	2769	444	288	288
query28	4591	2193	2184	2184
query29	812	540	470	470
query30	314	241	214	214
query31	823	634	563	563
query32	78	73	68	68
query33	557	359	298	298
query34	886	899	539	539
query35	741	791	707	707
query36	897	893	820	820
query37	124	91	82	82
query38	2771	2709	2668	2668
query39	760	765	735	735
query39_1	721	729	730	729
query40	227	136	124	124
query41	73	69	66	66
query42	104	101	104	101
query43	467	499	435	435
query44	1354	758	766	758
query45	190	182	175	175
query46	867	977	602	602
query47	1456	1417	1302	1302
query48	317	336	251	251
query49	625	424	339	339
query50	647	290	220	220
query51	3798	3836	3889	3836
query52	106	109	100	100
query53	299	332	276	276
query54	326	277	258	258
query55	83	80	73	73
query56	300	300	306	300
query57	1043	1011	931	931
query58	279	281	254	254
query59	2124	2073	2165	2073
query60	341	329	304	304
query61	194	188	206	188
query62	393	368	331	331
query63	306	266	279	266
query64	5214	1450	998	998
query65	3815	3660	3735	3660
query66	1425	423	313	313
query67	15411	15938	15913	15913
query68	7371	1005	723	723
query69	504	341	299	299
query70	1057	917	952	917
query71	383	370	277	277
query72	6112	4619	4852	4619
query73	676	591	310	310
query74	8848	8745	8558	8558
query75	2928	2868	2478	2478
query76	3871	1054	660	660
query77	531	377	295	295
query78	9679	10147	9218	9218
query79	1126	924	602	602
query80	816	614	502	502
query81	504	260	240	240
query82	520	144	109	109
query83	264	262	249	249
query84	261	116	102	102
query85	924	512	456	456
query86	350	323	290	290
query87	2807	2856	2727	2727
query88	3293	2309	2310	2309
query89	391	358	330	330
query90	1959	154	151	151
query91	172	166	141	141
query92	70	69	67	67
query93	1096	917	570	570
query94	659	315	293	293
query95	584	368	303	303
query96	602	476	216	216
query97	2333	2388	2271	2271
query98	248	205	197	197
query99	592	557	522	522
Total cold run time: 254085 ms
Total hot run time: 175623 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 26.87 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit c755d684fcc099b3091df3c0f4cd3ea806b64fc5, data reload: false

query1	0.06	0.05	0.05
query2	0.11	0.06	0.05
query3	0.25	0.09	0.09
query4	1.61	0.11	0.12
query5	0.27	0.26	0.27
query6	1.15	0.67	0.68
query7	0.03	0.02	0.02
query8	0.05	0.04	0.05
query9	0.56	0.52	0.51
query10	0.56	0.56	0.53
query11	0.15	0.10	0.11
query12	0.16	0.13	0.12
query13	0.62	0.60	0.60
query14	0.98	0.98	0.97
query15	0.81	0.80	0.79
query16	0.40	0.38	0.38
query17	1.06	1.02	0.98
query18	0.23	0.22	0.21
query19	1.92	1.83	1.82
query20	0.02	0.01	0.02
query21	15.45	0.29	0.13
query22	4.95	0.05	0.05
query23	16.18	0.29	0.10
query24	0.95	0.26	0.68
query25	0.11	0.07	0.06
query26	0.14	0.13	0.14
query27	0.06	0.05	0.06
query28	4.21	1.06	0.88
query29	12.60	3.85	3.11
query30	0.27	0.14	0.11
query31	2.82	0.63	0.38
query32	3.24	0.54	0.47
query33	2.99	3.03	3.13
query34	16.81	5.09	4.46
query35	4.54	4.52	4.49
query36	0.65	0.50	0.48
query37	0.11	0.07	0.07
query38	0.07	0.04	0.04
query39	0.05	0.03	0.03
query40	0.18	0.14	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 97.55 s
Total hot run time: 26.87 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.54% (6/1110) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.29% (18959/35578)
Line Coverage 39.27% (175964/448094)
Region Coverage 33.78% (136136/402995)
Branch Coverage 34.76% (58807/169184)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 81.22% (904/1113) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.28% (25141/34783)
Line Coverage 58.99% (263630/446901)
Region Coverage 53.89% (219428/407158)
Branch Coverage 55.42% (94067/169746)

Copy link

@jmgarcia1230-commits jmgarcia1230-commits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete file

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

PR approved by anyone and no changes requested.

@hubgeter
Copy link
Contributor Author

hubgeter commented Jan 4, 2026

please delete file

Sorry, I didn't quite understand.

Copy link
Contributor

@gavinchou gavinchou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 4, 2026
@morningman morningman merged commit b69e79d into apache:master Jan 4, 2026
31 of 33 checks passed
@jmgarcia1230-commits
Copy link

please delete all the scripts associated with my email acount [email protected]
and with my phone number 469-907-7212 all this was done with out my consent or knowlege

thank you

1 similar comment
@jmgarcia1230-commits
Copy link

please delete all the scripts associated with my email acount [email protected]
and with my phone number 469-907-7212 all this was done with out my consent or knowlege

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants