Skip to content

JDBC appender loses track on certain sequences of unions and structs. #554

Closed

Description

@cps-cfl

TestDuck.java

I encountered something weird that seems like a bug in the JDBC appender. I have reproduced it in a relatively minimal test attached. The data is shaped like

  • a UNION(STRUCT, BOOLEAN), b STRUCT or
  • a UNION(BOOLEAN, STRUCT), b STRUCT

In the first case when you try and begin the struct for b you get an error which seems to indicate that it is expecting you to append the BOOLEAN to the union, despite the union being closed. Strangely if you append null in the union after appending the struct then it is happy.

In the second case everything works as I'd expect. Certainly if you try and append null in the analogous point it explodes.

The error message it gives is included in the test but I'll repeat it here if only for search fodder:-

Appender error, catalog: 'null', schema: 'main', table: 'TEST', message: invalid column type, expected one of: '[DUCKDB_TYPE_STRUCT]', actual: 'DUCKDB_TYPE_BOOLEAN'

Activity

  1. added a commit that references this issue on Feb 6, 2026
    0c73c76
  2. staticlibs commented on Feb 6, 2026

    @staticlibs
    Member

    Hi, thanks for the report! Yes, the logic for UNION handling was incomplete, I filed #556 to fix this. Going to include it into the 1.5.0.0 update next week.

  3. added 2 commits that reference this issue on Feb 8, 2026
    913ffca
    5085a61
  4. added 3 commits that reference this issue on Feb 9, 2026
    5d93ac7
    79fe0cb
    f283601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions