Add convert to DataBytes and materialize for plain vectors of values - #2
Merged
Merged
Conversation
- `convert(DataBytes, ::AbstractVector{UInt8})` (and the identity for a `DataBytes`), so
`Vector{DataBytes}` and `Vector{Union{Missing, DataBytes}}` accept byte vectors the way
`DataString` already accepts strings.
- `materialize` on a plain `Vector` of `DataString`/`DataBytes` values (with or without
`missing`): copies every element out to an owned `String`/`Vector{UInt8}`, detaching it
from the buffers the values reference. Until now it applied only to `StringVector` /
`BytesVector` columns; a column a data source handed out (MySQL.jl 2.0 results, for
example) had no way to be detached in one call.
- Version 1.1.0.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two gaps found while making MySQL.jl 2.0 return
DataString/DataBytesvalues:convert(DataBytes, ::AbstractVector{UInt8})did not exist, so aVector{DataBytes}(orVector{Union{Missing, DataBytes}}) could not be built from byte vectors the wayVector{DataString}is built from strings. Added, together with the identity method for aDataBytesargument (no ambiguity with Base's arrayconvert; the existingdetect_ambiguitiestest covers it).materializeapplied only toStringVector/BytesVectorcolumns. A plainVectorof values, such as a column a data source handed out, had no single call to copy every element out and detach it from the buffers the values reference.materializenow acceptsAbstractVector{DataString},AbstractVector{Union{Missing, DataString}}, and theDataBytescounterparts, returningVector{String}/Vector{Union{String, Missing}}(orVector{UInt8}variants),missingpreserved.Tests cover the conversions, the four
materializeelement types, and that a materialized copy survives the source buffer being overwritten. The README's API list mentions the newmaterializeinputs. Version bumped to 1.1.0 (new API); drop that commit hunk if you prefer to bump at release time.🤖 Generated with Claude Code