Skip to content

feat(appender): AppendBytes for opt-in zero-copy VARCHAR/JSON#138

Open
adubovikov wants to merge 2 commits into
duckdb:mainfrom
adubovikov:homer/append-bytes
Open

feat(appender): AppendBytes for opt-in zero-copy VARCHAR/JSON#138
adubovikov wants to merge 2 commits into
duckdb:mainfrom
adubovikov:homer/append-bytes

Conversation

@adubovikov
Copy link
Copy Markdown

@adubovikov adubovikov commented May 18, 2026

Summary

Adds opt-in types for Appender columns without changing plain []byte behavior in AppendRow:

Value in AppendRow Behavior
[]byte / string Unchanged — copying VectorAssignStringElementLen (C.CBytes)
AppendBytes Zero-copy + UTF-8 validation (VectorAssignByteElement)
AppendBytesUnsafe Zero-copy, no UTF-8 check
json.RawMessage (JSON columns) Routed to AppendBytesUnsafe

Dependencies

Requires duckdb/duckdb-go-bindings#84 (VectorAssignByteElement, fixed UnsafeVectorAssignStringElementLen). Merge bindings first, then bump go.mod dependency version if needed before merging this PR.

Test plan

  • TestAppendBytes_varcharRoundTrip (passes once bindings Update DuckDB to v1.4.3 #84 is in the module version CI uses)
  • Full CI after bindings release

Plain []byte in AppendRow keeps VectorAssignStringElementLen (C.CBytes copy).
AppendBytes / AppendBytesUnsafe opt into VectorAssignByteElement when available
in duckdb-go-bindings (requires duckdb/duckdb-go-bindings#84).

json.RawMessage in setJSON maps to AppendBytesUnsafe.
@adubovikov adubovikov changed the title feat(appender): AppendBytes for zero-copy VARCHAR/JSON columns feat(appender): AppendBytes for opt-in zero-copy VARCHAR/JSON May 18, 2026
@adubovikov adubovikov force-pushed the homer/append-bytes branch from b90fc1e to b7cf11c Compare May 18, 2026 23:17
@adubovikov
Copy link
Copy Markdown
Author

any one can review it or nobody interest on any PR ?

@taniabogatsch
Copy link
Copy Markdown
Member

@adubovikov - this depends on changes in the bindings package, no? So we can come back to it once the changes are merged/discussed there.

@taniabogatsch taniabogatsch added feature / enhancement Code improvements or a new feature requires latest tagged dependency Relies on latest (untagged) changes in a dependency labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature / enhancement Code improvements or a new feature requires latest tagged dependency Relies on latest (untagged) changes in a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants