Skip to content

Commit 4a97f08

Browse files
committed
Appender: support primitive lists (1.4)
This is a backport of the PR #398 to `v1.4-andium` stable branch. This change allows to append to primitive `LIST` columns using the same methods that were used to append to primitive `ARRAY` columns. Appending to nested lists or lists of arrays is not yet supported. Testing: existing tests restructured and extended to cover primitive `LIST`s.
1 parent cd112c6 commit 4a97f08

8 files changed

Lines changed: 1515 additions & 1265 deletions

File tree

src/jni/bindings_vector.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,20 @@ JNIEXPORT jobject JNICALL Java_org_duckdb_DuckDBBindings_duckdb_1vector_1get_1co
8080
* Signature: (Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
8181
*/
8282
JNIEXPORT jobject JNICALL Java_org_duckdb_DuckDBBindings_duckdb_1vector_1get_1data(JNIEnv *env, jclass, jobject vector,
83-
jlong col_width_bytes) {
83+
jlong size_bytes) {
8484

8585
duckdb_vector vec = vector_buf_to_vector(env, vector);
8686
if (env->ExceptionCheck()) {
8787
return nullptr;
8888
}
89-
idx_t width = jlong_to_idx(env, col_width_bytes);
89+
idx_t vector_size = jlong_to_idx(env, size_bytes);
9090
if (env->ExceptionCheck()) {
9191
return nullptr;
9292
}
9393

9494
void *data = duckdb_vector_get_data(vec);
9595

9696
if (data != nullptr) {
97-
idx_t vector_size = duckdb_vector_size() * width;
9897
return make_data_buf(env, data, vector_size);
9998
}
10099

0 commit comments

Comments
 (0)