Skip to content

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

@cps-cfl

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'

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