We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3152192 commit f5df0a9Copy full SHA for f5df0a9
1 file changed
src/aws/compression/arrow/compress.c
@@ -15,6 +15,20 @@
15
#include <fluent-bit/flb_mem.h>
16
#include <inttypes.h>
17
18
+static int choose_block_size(size_t size)
19
+{
20
+ int block_size = 8 * 1024 * 1024;
21
+
22
+ while ((size_t) block_size <= size) {
23
+ block_size *= 2;
24
+ if (block_size > 64 * 1024 * 1024) {
25
+ return 64 * 1024 * 1024;
26
+ }
27
28
29
+ return block_size;
30
+}
31
32
/*
33
* GArrowTable is the central structure that represents "table" (a.k.a.
34
* data frame).
@@ -46,6 +60,10 @@ static GArrowTable* parse_json(uint8_t *json, int size)
46
60
return NULL;
47
61
}
48
62
63
+ g_object_set(options,
64
+ "block-size", choose_block_size(size),
65
+ NULL);
66
49
67
reader = garrow_json_reader_new(GARROW_INPUT_STREAM(input), options, &error);
50
68
if (reader == NULL) {
51
69
g_error_free(error);
0 commit comments