Skip to content

Commit

Permalink
[VL] In ColumnarBatchSerializerJniWrapper_serialize, check if the b…
Browse files Browse the repository at this point in the history
…yte array is constructed successfully (#7733)
  • Loading branch information
NEUpanning authored Nov 5, 2024
1 parent 8b22ced commit 3108d91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/core/jni/JniWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,10 @@ JNIEXPORT jobject JNICALL Java_org_apache_gluten_vectorized_ColumnarBatchSeriali
auto serializer = ctx->createColumnarBatchSerializer(nullptr);
auto buffer = serializer->serializeColumnarBatches(batches);
auto bufferArr = env->NewByteArray(buffer->size());
GLUTEN_CHECK(
bufferArr != nullptr,
"Cannot construct a byte array of size " + std::to_string(buffer->size()) +
" byte(s) to serialize columnar batches");
env->SetByteArrayRegion(bufferArr, 0, buffer->size(), reinterpret_cast<const jbyte*>(buffer->data()));

jobject columnarBatchSerializeResult =
Expand Down

0 comments on commit 3108d91

Please sign in to comment.