You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a backport of the PR duckdb#372 to `v1.4-andium` stable branch.
This PR adds support for appending data to `UNION` columns. The tag
(field name) of the union must be specified in `beginUnion()` call
before appending the actual value.
Nested unions (or structs inside unions) are not supported.
Example:
```sql
CREATE TABLE tab1 (col1 INTEGER, col2 UNION(u1 INTEGER, u2 VARCHAR))
```
```java
DuckDBAppender appender = conn.createAppender("tab1");
// append row with INTEGER value in UNION
appender
.beginRow()
.append(1)
.beginUnion("u1")
.append(42)
.endUnion()
.endRow();
// append row with VARCHAR value in UNION
appender
.beginRow()
.append(2)
.beginUnion("u2")
.append("foo")
.endUnion()
.endRow();
```
Testing: existing test is extended to cover `UNION`s.
0 commit comments