Skip to content

Appender: support nested STRUCTs#396

Merged
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:appender_nested
Sep 23, 2025
Merged

Appender: support nested STRUCTs#396
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:appender_nested

Conversation

@staticlibs
Copy link
Collaborator

@staticlibs staticlibs commented Sep 21, 2025

This PR adds support to nested STRUCT and UNION columns in Appender. There are no nesting limit enforced on Java side.

Usage example:

CREATE TABLE tab1 (
    col1 INTEGER,
    col2 STRUCT (
        s1 INTEGER,
        s2 UNION (
            u1 INTEGER,
            u2 STRUCT (
                us1 INTEGER,
                us2 INTEGER[2],
                us3 VARCHAR
            )
        )
    ),
    col3 VARCHAR
)
try (DuckDBAppender appender = conn.createAppender("tab1")) {
     appender.
        .beginRow()
        .append(45)
        .beginStruct()
        .append(46)
        .beginUnion("u2")
        .beginStruct()
        .append(47)
        .append(new int[] {48, 49})
        .append("bar")
        .endStruct()
        .endUnion()
        .endStruct()
        .append("baz")
        .endRow();
}

Testing: existing test is extended to cover nested STRUCTs.

This PR adds support to nested `STRUCT` and `UNION` columns in
`Appender`. There are no nesting limit enforced on Java side.

Testing: existing test is extended to cover nested `STRUCT`s.
@staticlibs staticlibs merged commit a805cf8 into duckdb:main Sep 23, 2025
9 checks passed
@staticlibs staticlibs deleted the appender_nested branch September 23, 2025 12:51
staticlibs added a commit to staticlibs/duckdb-java that referenced this pull request Oct 3, 2025
This is a backport of the PR duckdb#396 to `v1.4-andium` stable branch.

This PR adds support to nested `STRUCT` and `UNION` columns in
`Appender`. There are no nesting limit enforced on Java side.

Testing: existing test is extended to cover nested `STRUCT`s.
staticlibs added a commit that referenced this pull request Oct 3, 2025
This is a backport of the PR #396 to `v1.4-andium` stable branch.

This PR adds support to nested `STRUCT` and `UNION` columns in
`Appender`. There are no nesting limit enforced on Java side.

Testing: existing test is extended to cover nested `STRUCT`s.
staticlibs added a commit that referenced this pull request Oct 3, 2025
This is a backport of the PR #396 to `v1.4-andium` stable branch.

This PR adds support to nested `STRUCT` and `UNION` columns in
`Appender`. There are no nesting limit enforced on Java side.

Testing: existing test is extended to cover nested `STRUCT`s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant