zhztheplayer commented on code in PR #11728:
URL:
https://github.com/apache/incubator-gluten/pull/11728#discussion_r2905383876
##########
cpp/velox/jni/JniHashTable.h:
##########
@@ -26,13 +26,13 @@
namespace gluten {
-inline static JavaVM* vm = nullptr;
+extern JavaVM* vm;
Review Comment:
nit: Is gluten::vm too wild? Can we possibly wrap the hash table builder in
a wrapper class where the static objects can be stored as members?
##########
cpp/velox/jni/VeloxJniWrapper.cc:
##########
@@ -949,7 +947,19 @@ JNIEXPORT jlong JNICALL
Java_org_apache_gluten_vectorized_HashJoinBuilder_native
jint broadcastHashTableBuildThreads) {
JNI_METHOD_START
const auto hashTableId = jStringToCString(env, tableId);
- const auto hashJoinKey = jStringToCString(env, joinKey);
+
+ // Convert Java String array to C++ vector<string>
+ std::vector<std::string> hashJoinKeys;
+ jsize joinKeysCount = env->GetArrayLength(joinKeys);
+ hashJoinKeys.reserve(joinKeysCount);
+ for (jsize i = 0; i < joinKeysCount; ++i) {
+ jstring jkey = (jstring)env->GetObjectArrayElement(joinKeys, i);
+ const char* keyChars = env->GetStringUTFChars(jkey, nullptr);
+ hashJoinKeys.emplace_back(keyChars);
+ env->ReleaseStringUTFChars(jkey, keyChars);
+ env->DeleteLocalRef(jkey);
Review Comment:
nit: There is a helper `jStringToCString`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]