Skip to content

Commit 4d7464e

Browse files
committed
Revert "pre-allocate buf in gandiva for variable len vector (apache#99)"
This reverts commit 179eff6.
1 parent aa6e0d5 commit 4d7464e

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

cpp/src/arrow/util/compression_zlib_isal.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ class GZipCodec : public Codec {
375375
ret = isal_inflate(&state_);
376376
if (ret == ISAL_BLOCK_FINISH || ret == ISAL_DECOMP_OK) break;
377377

378+
printf("AAA");
378379
// Failure, buffer was too small
379380
return Status::IOError("Too small a buffer passed to GZipCodec. InputLength=",
380381
input_length, " OutputLength=", output_buffer_length);

cpp/src/gandiva/cache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace gandiva {
2222

23-
static const int DEFAULT_CACHE_SIZE = 2000;
23+
static const int DEFAULT_CACHE_SIZE = 500;
2424

2525
int GetCapacity() {
2626
int capacity;

cpp/src/gandiva/jni/jni_common.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,8 @@ Java_org_apache_arrow_gandiva_evaluator_JniWrapper_evaluateProjector(
848848
"null");
849849
break;
850850
}
851-
auto buf = std::make_shared<JavaResizableBuffer>(env, jexpander,
852-
output_vector_idx, value_buf, data_sz);
853-
buf->Resize(3970*16, false);
854-
buffers.push_back(buf);
851+
buffers.push_back(std::make_shared<JavaResizableBuffer>(
852+
env, jexpander, output_vector_idx, value_buf, data_sz));
855853
} else {
856854
buffers.push_back(std::make_shared<arrow::MutableBuffer>(value_buf, data_sz));
857855
}

cpp/src/gandiva/projector.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Status Projector::AllocArrayData(const DataTypePtr& type, int64_t num_records,
291291
data_len = arrow::BitUtil::BytesForBits(num_records * fw_type.bit_width());
292292
} else if (arrow::is_binary_like(type_id)) {
293293
// we don't know the expected size for varlen output vectors.
294-
data_len = 3970 * 8;
294+
data_len = 0;
295295
} else {
296296
return Status::Invalid("Unsupported output data type " + type->ToString());
297297
}

0 commit comments

Comments
 (0)