This is an automated email from the ASF dual-hosted git repository. quinnj pushed a commit to branch preservation/storage-20261008/Documents-Codex-2026-09-04-i-have-an-open-pr-for-downstream-Arrow-42815a7e in repository https://gitbox.apache.org/repos/asf/arrow-julia.git
commit 7b51155f80f52c9080a049f019a601c15f74feed Author: Jacob Quinn <[email protected]> AuthorDate: Thu Oct 8 22:58:15 2026 -0600 chore: preserve local work before storage cleanup [skip ci] Preservation snapshot of unfinished local work. This commit saves existing changes; it does not assert functional validation. AI disclosure: This work was prepared with assistance from OpenAI Codex. --- Project.toml | 12 ++++---- conformance/Project.toml | 4 +-- conformance/run.jl | 2 +- docs/Project.toml | 4 +-- src/Arrow.jl | 4 +-- src/ArrowCore.jl | 4 +-- src/columnconstruction.jl | 26 ++++++++-------- src/table.jl | 6 ++-- test/Project.toml | 4 +-- test/arrowtypes_compat_tests.jl | 10 +++--- test/core_tests.jl | 4 +-- test/facade_tests.jl | 64 +++++++++++++++++++-------------------- test/rewrite_regressions.jl | 14 ++++----- test/scan_battery.jl | 2 +- test/support/AcceptanceSupport.jl | 2 +- test/support/SeededFuzz.jl | 24 +++++++-------- test/trim_compile_tests.jl | 4 +-- test/trim_entrypoint.jl | 24 +++++++-------- 18 files changed, 107 insertions(+), 107 deletions(-) diff --git a/Project.toml b/Project.toml index 45d48cd..d1d74b4 100644 --- a/Project.toml +++ b/Project.toml @@ -20,25 +20,25 @@ authors = ["quinnj <[email protected]>"] version = "3.0.0-DEV" [deps] -ArrowStrings = "c38d8858-22a2-449e-9eca-ef92ec15f353" +DataStrings = "48204bd6-5611-42ea-b167-fc1d713f9be2" ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561" CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2" DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" -Decimals = "abce61dc-4473-55a0-ba07-351d65e31d42" +DataDecimals = "3e2245cb-6932-498d-a7cf-39d39de8bde3" EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56" Mmap = "a63ad114-7e13-5084-954f-fe012c677804" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -# ArrowStrings and ArrowTypes live in this repository and are released and +# DataStrings and ArrowTypes live in this repository and are released and # registered independently; the source entries resolve their subdirectories. # Pkg reads `[sources]` from Julia 1.11; on 1.10 the CI workflow devs both explicitly. [sources] -ArrowStrings = {path = "src/ArrowStrings"} +DataStrings = {path = "../../releases/DataStrings.jl"} ArrowTypes = {path = "src/ArrowTypes"} [weakdeps] @@ -50,14 +50,14 @@ ArrowCloudStoreExt = "CloudStore" ArrowTimeZonesExt = "TimeZones" [compat] -ArrowStrings = "1" +DataStrings = "1" ArrowTypes = "2" Base64 = "1.10" CloudStore = "1.6" CodecLz4 = "0.4" DataAPI = "1" Dates = "1.10" -Decimals = "1" +DataDecimals = "1" CodecZstd = "0.8" EnumX = "1" Mmap = "1.10" diff --git a/conformance/Project.toml b/conformance/Project.toml index 4b4108a..c94a7ee 100644 --- a/conformance/Project.toml +++ b/conformance/Project.toml @@ -17,7 +17,7 @@ [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" -ArrowStrings = "c38d8858-22a2-449e-9eca-ef92ec15f353" +DataStrings = "48204bd6-5611-42ea-b167-fc1d713f9be2" ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" @@ -30,7 +30,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" [compat] -ArrowStrings = "=1.0.0" +DataStrings = "=1.0.0" ArrowTypes = "=2.4.0" CodecLz4 = "=0.4.6" CodecZlib = "=0.7.9" diff --git a/conformance/run.jl b/conformance/run.jl index de02035..9fb2dfd 100644 --- a/conformance/run.jl +++ b/conformance/run.jl @@ -99,7 +99,7 @@ function main(args) """using Pkg cp("/work/conformance/Project.toml", "/opt/env/Project.toml"; force=true) Pkg.develop([ - PackageSpec(path="/work/src/ArrowStrings"), + PackageSpec(path="/work/src/DataStrings"), PackageSpec(path="/work/src/ArrowTypes"), PackageSpec(path="/work"), ]) diff --git a/docs/Project.toml b/docs/Project.toml index f431466..a05cb1c 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -17,14 +17,14 @@ [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" -ArrowStrings = "c38d8858-22a2-449e-9eca-ef92ec15f353" +DataStrings = "48204bd6-5611-42ea-b167-fc1d713f9be2" ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] -ArrowStrings = "1" +DataStrings = "1" ArrowTypes = "2" DataAPI = "1" Documenter = "1.17" diff --git a/src/Arrow.jl b/src/Arrow.jl index 756c7cf..b2f34a0 100644 --- a/src/Arrow.jl +++ b/src/Arrow.jl @@ -47,10 +47,10 @@ module Arrow using Tables import Base64 import DataAPI -import ArrowStrings +import DataStrings import ArrowTypes import Dates -import Decimals +import DataDecimals import Mmap import CodecLz4 import CodecZstd diff --git a/src/ArrowCore.jl b/src/ArrowCore.jl index ef9c4f1..608d83e 100644 --- a/src/ArrowCore.jl +++ b/src/ArrowCore.jl @@ -2053,7 +2053,7 @@ juliatype(t::DecimalType) = t.bits == 32 ? Int32 : t.bits == 64 ? Int64 : Vector # `primwidth(t)` two's-complement native-endian bytes, and `juliatype` can # only name the 32/64-bit ones (Base has no 128/256-bit decimal, hence the # byte-vector domain above). So the typed claim widens here alone: a caller -# that DOES own a decimal value type — the facade's `Decimals.Decimal{P,S,T}` +# that DOES own a decimal value type — the facade's `DataDecimals.Decimal{P,S,T}` # — may claim any isbits type of exactly the layout width, and Core copies # the coefficient bytes verbatim. Every other layout keeps exact-match-only. _decimalclaim(::Type{E}, t::DecimalType) where {E} = @@ -3749,7 +3749,7 @@ end Wrap a vector of Arrow view entries as a Utf8View column, ZERO-COPY. `P` is any 16-byte isbits type whose values are Arrow StringView entries — the -representation ArrowStrings' `ArrowString` columns use: +representation DataStrings' `DataString` columns use: bytes 0..3 Int32 content length (negative marks a null slot) bytes 4..15 the content, zero-padded (length ≤ 12) diff --git a/src/columnconstruction.jl b/src/columnconstruction.jl index e363790..463b807 100644 --- a/src/columnconstruction.jl +++ b/src/columnconstruction.jl @@ -79,15 +79,15 @@ function _constructnativepart(name::String, v::AbstractVector; context=nothing) AC.DurationType(unit), x -> Int64(Dates.value(x)), ) - elseif T <: Decimals.Decimal + elseif T <: DataDecimals.Decimal return _constructdecimalpart(name, v, T) - elseif T <: Decimals.DecimalValue + elseif T <: DataDecimals.DecimalValue throw( ArgumentError( "column $name holds DecimalValue values, whose scale travels " * "with each value; an Arrow decimal column declares ONE scale " * "in its schema. Convert the column to a fixed scale first, " * - "e.g. `Decimals.rescale.(Decimal{P,S}, $name)`", + "e.g. `DataDecimals.rescale.(Decimal{P,S}, $name)`", ), ) elseif T <: NamedTuple @@ -256,14 +256,14 @@ function _narrowlists(v::AbstractVector) return S[x === missing ? missing : convert(Vector{E}, x) for x in w] end -# An ArrowStrings column IS Utf8View memory: its payload vector is the views +# An DataStrings column IS Utf8View memory: its payload vector is the views # buffer and its byte buffers are the variadic data buffers — no copy, no # String materialization. Nullability comes from the column's eltype. # Both keywords are accepted for dispatch uniformity; a StringVector is # already Arrow memory, so no context or narrowing applies. function _constructpart( name::String, - v::ArrowStrings.StringVector; + v::DataStrings.StringVector; context=nothing, narrowabstract::Bool=true, ) @@ -318,7 +318,7 @@ function _constructtemporalpart( end """ -Construct one fresh Arrow decimal part from a `Decimals.Decimal{P,S,T}` +Construct one fresh Arrow decimal part from a `DataDecimals.Decimal{P,S,T}` column. Unlike the temporal path there is nothing to convert: the Julia coefficient IS the Arrow slot, so `P` and `S` become the descriptor's precision and scale, `T`'s width becomes its bitWidth (32/64/128/256), and a @@ -334,7 +334,7 @@ function _constructdecimalpart( name::String, v::AbstractVector, ::Type{D}, -) where {P,S,T,D<:Decimals.Decimal{P,S,T}} +) where {P,S,T,D<:DataDecimals.Decimal{P,S,T}} t = AC.DecimalType(P, S, 8 * sizeof(T)) if !(eltype(v) >: Missing) values = _plainvector(v) @@ -419,7 +419,7 @@ _arrowtypesnativetype(T) = Dates.DateTime, Dates.Time, Dates.Period, - Decimals.AbstractDecimal, + DataDecimals.AbstractDecimal, } || _zonedwritertype(T) # The TimeZones extension's write hooks. With the extension absent both @@ -3790,11 +3790,11 @@ end function _retainedview(f::AC.Field, v::AbstractVector) t = f.type::AC.ViewType present = _retainedvalidity(f, v) - payloads = Vector{ArrowStrings.ArrowStringPayload}(undef, length(v)) + payloads = Vector{DataStrings.StringPayload}(undef, length(v)) data = UInt8[] for (i, x) in enumerate(v) if x === missing - payloads[i] = ArrowStrings.PAYLOAD_MISSING + payloads[i] = DataStrings.PAYLOAD_MISSING continue end bytes = if t.utf8 @@ -3807,15 +3807,15 @@ function _retainedview(f::AC.Field, v::AbstractVector) x end n = length(bytes) - if n <= ArrowStrings.INLINE_MAX - payloads[i] = ArrowStrings.inline_payload(bytes, 1, n) + if n <= DataStrings.INLINE_MAX + payloads[i] = DataStrings.inline_payload(bytes, 1, n) else length(data) <= typemax(Int32) - n || throw( ArgumentError("column $(f.name) view data exceeds the Int32 offset range"), ) off = length(data) append!(data, bytes) - payloads[i] = ArrowStrings.view_payload(data, off + 1, n, 0, off) + payloads[i] = DataStrings.view_payload(data, off + 1, n, 0, off) end end buffers = AC.BufferSlice[AC._bitmapbuffer(present), AC._databuffer(payloads)] diff --git a/src/table.jl b/src/table.jl index 87613cd..9be503a 100644 --- a/src/table.jl +++ b/src/table.jl @@ -669,10 +669,10 @@ _postconvert(t::AC.DictionaryType, col, budget=nothing) = _postconvert(t.valuetype, col, budget) # The storage integer and maximum precision behind each Arrow decimal width. -# `Decimals.Decimal`'s own per-storage digit capacities are exactly Arrow's +# `DataDecimals.Decimal`'s own per-storage digit capacities are exactly Arrow's # per-width precision ceilings, so the widths correspond one for one. _decimalstorage(bits::Int) = - bits == 32 ? Int32 : bits == 64 ? Int64 : bits == 128 ? Int128 : Decimals.Int256 + bits == 32 ? Int32 : bits == 64 ? Int64 : bits == 128 ? Int128 : DataDecimals.Int256 _decimalcapacity(bits::Int) = bits == 32 ? 9 : bits == 64 ? 18 : bits == 128 ? 38 : 76 """ @@ -693,7 +693,7 @@ function _decimalbasetype(t::AC.DecimalType) t.bits in (32, 64, 128, 256) || return raw 1 <= t.precision <= _decimalcapacity(t.bits) || return raw 0 <= t.scale <= t.precision || return raw - return Decimals.Decimal{t.precision,t.scale,_decimalstorage(t.bits)} + return DataDecimals.Decimal{t.precision,t.scale,_decimalstorage(t.bits)} end # The public element type of the SCALAR layouts the facade converts (Dates) diff --git a/test/Project.toml b/test/Project.toml index 46ededf..bab6754 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -23,8 +23,8 @@ CloudStore = "3365d9ee-d53b-4a56-812d-5344d5b716d7" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" -Decimals = "abce61dc-4473-55a0-ba07-351d65e31d42" -ArrowStrings = "c38d8858-22a2-449e-9eca-ef92ec15f353" +DataDecimals = "3e2245cb-6932-498d-a7cf-39d39de8bde3" +DataStrings = "48204bd6-5611-42ea-b167-fc1d713f9be2" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" diff --git a/test/arrowtypes_compat_tests.jl b/test/arrowtypes_compat_tests.jl index 28aa5dc..1e54213 100644 --- a/test/arrowtypes_compat_tests.jl +++ b/test/arrowtypes_compat_tests.jl @@ -21,7 +21,7 @@ using ArrowTypes using DataAPI using Dates -import Decimals +import DataDecimals using Tables using UUIDs @@ -860,7 +860,7 @@ ArrowTypes.JuliaType(::Val{ARROWTYPES_TEST_BYTES_ALIAS_NAME}, S, metadata) = ArrowTypes.fromarrow(::Type{ArrowTypesTestBytesAlias}, x::AbstractVector{UInt8}) = ArrowTypesTestBytesAlias(collect(UInt8, x)) -# A decimal column's ArrowTypes storage is `Decimals.Decimal{P,S,T}`, exactly +# A decimal column's ArrowTypes storage is `DataDecimals.Decimal{P,S,T}`, exactly # as a date column's is `Dates.Date` — so an extension over one is parametric # on the storage it labels, the way each Arrow decimal width has its own. struct ArrowTypesTestDecimalAlias{D} @@ -3868,7 +3868,7 @@ end end @testset "retained wide Decimal storage aliases" begin - for (bits, precision, storage) in ((128, 30, Int128), (256, 60, Decimals.Int256)) + for (bits, precision, storage) in ((128, 30, Int128), (256, 60, DataDecimals.Int256)) @testset "Decimal$bits" begin t = ARROWTYPES_TEST_AC.DecimalType(precision, 4, bits) field = ARROWTYPES_TEST_AC.Field( @@ -3879,7 +3879,7 @@ end ARROWTYPES_TEST_DECIMAL_ALIAS_NAME, ), ) - D = Decimals.Decimal{precision,4,storage} + D = DataDecimals.Decimal{precision,4,storage} coefficients = storage[storage(1234), storage(-5678)] data = ARROWTYPES_TEST_AC.ArrayData( t, @@ -3896,7 +3896,7 @@ end arrowtypes_test_retained_rewrites(field, data, expected) # A replacement in the wrong decimal storage is refused before any # value is written. - W = Decimals.Decimal{9,4,Int32} + W = DataDecimals.Decimal{9,4,Int32} wrong = ArrowTypesTestDecimalAlias{W}[ ArrowTypesTestDecimalAlias{W}(reinterpret(W, Int32(1))), ArrowTypesTestDecimalAlias{W}(reinterpret(W, Int32(2))), diff --git a/test/core_tests.jl b/test/core_tests.jl index fe1703a..7771171 100644 --- a/test/core_tests.jl +++ b/test/core_tests.jl @@ -928,8 +928,8 @@ end @test getvalue(llvf, llvd, 1) == [2, 3] end - @testset "fromviewentries: ArrowString payloads → Utf8View, zero-copy" begin - # A local encoder of the ArrowStrings payload (Core cannot depend on + @testset "fromviewentries: DataString payloads → Utf8View, zero-copy" begin + # A local encoder of the DataStrings payload (Core cannot depend on # the package), which IS an Arrow view entry: length | first 4 bytes, # then bytes 5..12 (≤12) or (Int32 buffer index, Int32 0-based # offset). Any 16-byte isbits type is accepted. diff --git a/test/facade_tests.jl b/test/facade_tests.jl index 76f8ab8..2a3a8a5 100644 --- a/test/facade_tests.jl +++ b/test/facade_tests.jl @@ -24,9 +24,9 @@ using Test using Tables using Dates import DataAPI -import Decimals +import DataDecimals using Arrow -using ArrowStrings +using DataStrings struct _InterruptingInteger <: Integer end struct _OutOfMemoryInteger <: Integer end @@ -1837,9 +1837,9 @@ end # compositions; empty and nonempty columns decide keep/drop alike. @test Arrow._declaredbasetype(Arrow.AC.ListViewType(false)) === Vector{Any} @test Arrow._declaredbasetype(Arrow.AC.DecimalType(9, 2, 32)) === - Decimals.Decimal32{2} + DataDecimals.Decimal32{2} @test Arrow._declaredbasetype(Arrow.AC.DecimalType(38, 2, 128)) === - Decimals.Decimal128{2} + DataDecimals.Decimal128{2} # A scale Decimal{P,S} cannot name keeps Core's raw coefficient domain. @test Arrow._declaredbasetype(Arrow.AC.DecimalType(10, -2, 32)) === Int32 @test Arrow._declaredbasetype(Arrow.AC.DecimalType(38, 40, 128)) === Vector{UInt8} @@ -2189,7 +2189,7 @@ end [AC.BufferSlice(), AC._databuffer(Int128[])]; nullcount=0, ), - Decimals.Decimal{10,2,Int128}, + DataDecimals.Decimal{10,2,Int128}, ), ( "d64", @@ -2200,7 +2200,7 @@ end [AC.BufferSlice(), AC._databuffer(Int64[])]; nullcount=0, ), - Decimals.Decimal{10,2,Int64}, + DataDecimals.Decimal{10,2,Int64}, ), ( "iym", @@ -2258,7 +2258,7 @@ end ) === Vector{Any} end - @testset "ArrowStrings columns write as Utf8View, zero-copy" begin + @testset "DataStrings columns write as Utf8View, zero-copy" begin # A StringVector's memory IS a Utf8View array: payloads are the # views buffer, its byte buffers the variadic data buffers. Build one # the way the CSV kernel does (inline ≤12, else a view into buffer 0 @@ -2269,13 +2269,13 @@ end extra = Vector{UInt8}(codeunits("she said \"hi\" and left")) long1 = first(findfirst(codeunits("thirteen-byte"), buf)) abcd = first(findfirst(codeunits("abcd"), buf)) - payloads = ArrowStringPayload[ - ArrowStrings.inline_payload(buf, abcd, 4), - ArrowStrings.view_payload(buf, long1, 13, 0, long1 - 1), - ArrowStrings.PAYLOAD_MISSING, - ArrowStrings.view_payload(extra, 1, length(extra), 1, 0), + payloads = StringPayload[ + DataStrings.inline_payload(buf, abcd, 4), + DataStrings.view_payload(buf, long1, 13, 0, long1 - 1), + DataStrings.PAYLOAD_MISSING, + DataStrings.view_payload(extra, 1, length(extra), 1, 0), ] - col = StringVector{Union{Missing,ArrowString}}(payloads, buf, extra) + col = StringVector{Union{Missing,DataString}}(payloads, buf, extra) f, columnparts = Arrow._constructcolumn(:s, AbstractVector[col]) d = only(columnparts) @test f.type == Arrow.AC.ViewType(true) && f.nullable @@ -2290,7 +2290,7 @@ end @test eltype(t.s) === Union{Missing,String} @test isequal(t.s, ["abcd", "thirteen-byte", missing, "she said \"hi\" and left"]) # a non-nullable column declares non-nullable - col0 = StringVector{ArrowString}(payloads[[1, 2]], buf, extra) + col0 = StringVector{DataString}(payloads[[1, 2]], buf, extra) f0, _ = Arrow._constructcolumn(:s, AbstractVector[col0]) @test !f0.nullable Arrow.write(io, (s=col0,)) @@ -2298,10 +2298,10 @@ end # an all-inline column may have ZERO data buffers — the format allows # a Utf8View with no variadic buffers, and the wire carries exactly # the fixed validity + views pair - inl = StringVector{ArrowString}( + inl = StringVector{DataString}( [ - ArrowStrings.inline_payload(buf, abcd, 4), - ArrowStrings.inline_payload(buf, abcd, 2), + DataStrings.inline_payload(buf, abcd, 4), + DataStrings.inline_payload(buf, abcd, 2), ], Vector{Vector{UInt8}}(), ) @@ -2321,7 +2321,7 @@ end # `Decimal{P,S,T}`'s per-storage digit capacities ARE Arrow's per-width # precision ceilings, so the correspondence is exact in both directions. const DECIMAL_WIDTHS = - ((32, 9, Int32), (64, 18, Int64), (128, 38, Int128), (256, 76, Decimals.Int256)) + ((32, 9, Int32), (64, 18, Int64), (128, 38, Int128), (256, 76, DataDecimals.Int256)) # One decimal column's Core buffers, written directly so the READ side is # exercised against a descriptor no Julia column produced. @@ -2336,10 +2336,10 @@ function decimalstream(t::Arrow.AC.DecimalType, coefficients, present=nothing) return Arrow.writestream(sch, [AC.RecordBatch(sch, Arrow.AC.ArrayData[d], n)]) end -@testset "Arrow decimals map to Decimals.Decimal" begin +@testset "Arrow decimals map to DataDecimals.Decimal" begin @testset "every width reads as its value type" begin for (bits, prec, T) in DECIMAL_WIDTHS - D = Decimals.Decimal{prec,2,T} + D = DataDecimals.Decimal{prec,2,T} coefficients = T[T(123), T(-456), T(0)] table = Arrow.Table( decimalstream(Arrow.AC.DecimalType(prec, 2, bits), coefficients), @@ -2347,8 +2347,8 @@ end @test eltype(table.dec) === D @test table.dec == D[reinterpret(D, c) for c in coefficients] # The coefficient is the Arrow slot verbatim, sign included. - @test Decimals.unscaled.(table.dec) == coefficients - @test Decimals.scale(eltype(table.dec)) == 2 + @test DataDecimals.unscaled.(table.dec) == coefficients + @test DataDecimals.scale(eltype(table.dec)) == 2 @test precision(first(table.dec)) == prec @test DataAPI.colmetadata(table, :dec, "unit") == "usd" end @@ -2356,7 +2356,7 @@ end @testset "nulls come from the validity bitmap" begin for (bits, prec, T) in DECIMAL_WIDTHS - D = Decimals.Decimal{prec,3,T} + D = DataDecimals.Decimal{prec,3,T} t = Arrow.AC.DecimalType(prec, 3, bits) bytes = decimalstream(t, T[T(7), T(0), T(-9)], Bool[true, false, true]) column = Arrow.Table(bytes).dec @@ -2370,7 +2370,7 @@ end @testset "columns round-trip through write" begin for (bits, prec, T) in DECIMAL_WIDTHS, scale in (0, 2, prec) - D = Decimals.Decimal{prec,scale,T} + D = DataDecimals.Decimal{prec,scale,T} values = D[typemin(D), reinterpret(D, T(-1)), zero(D), typemax(D)] nullable = Union{Missing,D}[values[1], missing, values[4], missing] for file in (false, true) @@ -2394,7 +2394,7 @@ end # Decimal32/64 are format 1.5 additions: a Decimal32 column writes as # a 32-bit decimal rather than inflating to the older 128-bit form. for (bits, _, T) in DECIMAL_WIDTHS - D = Decimals.Decimal{5,2,T} + D = DataDecimals.Decimal{5,2,T} io = IOBuffer() Arrow.write(io, (x=D[D("1.23")],); file=false) table = Arrow.Table(take!(io)) @@ -2405,7 +2405,7 @@ end end @testset "a non-nullable column is written zero-copy" begin - D = Decimals.Decimal{38,2,Int128} + D = DataDecimals.Decimal{38,2,Int128} column = D[reinterpret(D, Int128(i)) for i = 1:8] _, parts = Arrow._constructcolumn(:d, AbstractVector[column]) values = only(parts).buffers[2] @@ -2415,7 +2415,7 @@ end @testset "reads take Core's bulk copy at every width" begin for (bits, prec, T) in DECIMAL_WIDTHS - D = Decimals.Decimal{prec,0,T} + D = DataDecimals.Decimal{prec,0,T} t = Arrow.AC.DecimalType(prec, 0, bits) f = Arrow.AC.Field("dec", t; nullable=false) n = 512 @@ -2436,7 +2436,7 @@ end # The writer's pool identity walks storage fields; a decimal's whole # value lives in one wide primitive with no fields of its own. for (bits, prec, T) in DECIMAL_WIDTHS - D = Decimals.Decimal{prec,1,T} + D = DataDecimals.Decimal{prec,1,T} values = D[reinterpret(D, T(15)), reinterpret(D, T(15)), reinterpret(D, T(25))] io = IOBuffer() Arrow.write(io, (x=Arrow.DictEncode(values),); file=false) @@ -2517,7 +2517,7 @@ end @testset "DecimalValue is refused with a fix" begin io = IOBuffer() err = try - Arrow.write(io, (x=[Decimals.DecimalValue(123, 2)],); file=false) + Arrow.write(io, (x=[DataDecimals.DecimalValue(123, 2)],); file=false) nothing catch e e @@ -2534,10 +2534,10 @@ end f = AC.Field("dec", t; nullable=false) d = AC.ArrayData(t, 1, [AC.BufferSlice(), AC._databuffer(Int128[7])]; nullcount=0) # Right width, wrong precision/scale: still the caller's claim. - @test AC.materialize(Decimals.Decimal{38,2,Int128}, f, d)[1] == - reinterpret(Decimals.Decimal{38,2,Int128}, Int128(7)) + @test AC.materialize(DataDecimals.Decimal{38,2,Int128}, f, d)[1] == + reinterpret(DataDecimals.Decimal{38,2,Int128}, Int128(7)) # An eight-byte claim over a sixteen-byte slot must refuse. - @test_throws ArgumentError AC.materialize(Decimals.Decimal{18,2,Int64}, f, d) + @test_throws ArgumentError AC.materialize(DataDecimals.Decimal{18,2,Int64}, f, d) @test_throws ArgumentError AC.materialize(Int64, f, d) # Core's own byte domain stays claimable. @test AC.materialize(Vector{UInt8}, f, d)[1] == reinterpret(UInt8, Int128[7]) diff --git a/test/rewrite_regressions.jl b/test/rewrite_regressions.jl index f30d2bc..ca88f38 100644 --- a/test/rewrite_regressions.jl +++ b/test/rewrite_regressions.jl @@ -24,9 +24,9 @@ using Test using Dates using Tables import DataAPI -import Decimals +import DataDecimals using Arrow -using ArrowStrings +using DataStrings const AC = Arrow.ArrowCore @@ -154,11 +154,11 @@ end @testset "retained byte and scalar layouts rebuild exactly" begin raw = Vector{UInt8}(codeunits("short-thirteen-byte")) - payloads = ArrowStringPayload[ - ArrowStrings.inline_payload(raw, 1, 5), - ArrowStrings.view_payload(raw, 7, 13, 0, 6), + payloads = StringPayload[ + DataStrings.inline_payload(raw, 1, 5), + DataStrings.view_payload(raw, 7, 13, 0, 6), ] - strings = StringVector{ArrowString}(payloads, [raw]) + strings = StringVector{DataString}(payloads, [raw]) io = IOBuffer() Arrow.write(io, (s=strings,); file=false) viewbytes = take!(io) @@ -200,7 +200,7 @@ end ) decimalback = Arrow.readstream(_rewrite(decimalbytes)) @test decimalback.schema.fields[1].type == decimaltype - D = Decimals.Decimal{10,2,Int64} + D = DataDecimals.Decimal{10,2,Int64} @test Arrow.Table(_rewrite(decimalbytes)).dec == D[reinterpret(D, 123), reinterpret(D, 456)] end diff --git a/test/scan_battery.jl b/test/scan_battery.jl index e43c0e8..f09acd5 100644 --- a/test/scan_battery.jl +++ b/test/scan_battery.jl @@ -417,7 +417,7 @@ function _scan_main() routeclaims = ( Field("binary", BinaryType(false); nullable=false) => Vector{UInt8}, Field("decimal", DecimalType(10, 2, 128); nullable=false) => - Decimals.Decimal{10,2,Int128}, + DataDecimals.Decimal{10,2,Int128}, # A scale `Decimal{P,S}` cannot name keeps the raw byte domain. Field("decimal_wide_scale", DecimalType(10, 40, 128); nullable=false) => Vector{UInt8}, diff --git a/test/support/AcceptanceSupport.jl b/test/support/AcceptanceSupport.jl index d113edb..eed9f38 100644 --- a/test/support/AcceptanceSupport.jl +++ b/test/support/AcceptanceSupport.jl @@ -18,7 +18,7 @@ module AcceptanceSupport import Arrow -import Decimals +import DataDecimals using PooledArrays using Tables import Base64 diff --git a/test/support/SeededFuzz.jl b/test/support/SeededFuzz.jl index 2f91fb1..391d44b 100644 --- a/test/support/SeededFuzz.jl +++ b/test/support/SeededFuzz.jl @@ -17,7 +17,7 @@ module SeededFuzz using Arrow -using ArrowStrings +using DataStrings using ArrowTypes using Dates using Tables @@ -676,13 +676,13 @@ function _logical_layout_case() raw = collect(codeunits("tiny-a-view-value-longer-than-twelve-bytes")) longstart = findfirst(==(UInt8('a')), raw) longlength = length(raw) - longstart + 1 - payloads = ArrowStrings.ArrowStringPayload[ - ArrowStrings.inline_payload(raw, 1, 4), - ArrowStrings.view_payload(raw, longstart, longlength, 0, longstart - 1), - ArrowStrings.PAYLOAD_MISSING, - ArrowStrings.inline_payload(raw, 1, 0), + payloads = DataStrings.StringPayload[ + DataStrings.inline_payload(raw, 1, 4), + DataStrings.view_payload(raw, longstart, longlength, 0, longstart - 1), + DataStrings.PAYLOAD_MISSING, + DataStrings.inline_payload(raw, 1, 0), ] - views = ArrowStrings.StringVector{Union{Missing,ArrowStrings.ArrowString}}( + views = DataStrings.StringVector{Union{Missing,DataStrings.DataString}}( payloads, Vector{UInt8}[raw], ) @@ -829,10 +829,10 @@ function _physical_layout_case() ) longbinary = collect(UInt8, 0x10:0x20) - binarypayloads = ArrowStrings.ArrowStringPayload[ - ArrowStrings.inline_payload(UInt8[0x01, 0x02], 1, 2), - ArrowStrings.view_payload(longbinary, 1, length(longbinary), 0, 0), - ArrowStrings.PAYLOAD_MISSING, + binarypayloads = DataStrings.StringPayload[ + DataStrings.inline_payload(UInt8[0x01, 0x02], 1, 2), + DataStrings.view_payload(longbinary, 1, length(longbinary), 0, 0), + DataStrings.PAYLOAD_MISSING, ] binaryviewtype = AC.ViewType(false) push!(fields, AC.Field("binary_view", binaryviewtype; nullable=true)) @@ -1755,7 +1755,7 @@ function _source_revision() end function _environmenttext() - packages = (Arrow, ArrowStrings, ArrowTypes, Tables) + packages = (Arrow, DataStrings, ArrowTypes, Tables) lines = String["julia_version=$(VERSION)", "source_revision=$(_source_revision())"] for package in packages push!(lines, "$(nameof(package))_version=$(Base.pkgversion(package))") diff --git a/test/trim_compile_tests.jl b/test/trim_compile_tests.jl index 5cb12fa..4d47ad2 100644 --- a/test/trim_compile_tests.jl +++ b/test/trim_compile_tests.jl @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# JuliaC `--trim=safe` compile gate for ArrowCore and ArrowStrings, following the harness +# JuliaC `--trim=safe` compile gate for ArrowCore and DataStrings, following the harness # convention from JSON/HTTP/Reseau/StructUtils: compile the workload # entrypoint, require ZERO verifier errors and ZERO verifier warnings, then # run the produced binary and require exit 0. @@ -93,7 +93,7 @@ function _count_verifier_messages(output::String)::Tuple{Int,Int} return errors, warnings end -@testset "ArrowCore and ArrowStrings trim compile" begin +@testset "ArrowCore and DataStrings trim compile" begin if !_TRIM_SUPPORTED println("[trim] skip: JuliaC --trim requires Julia >= 1.12") elseif Sys.iswindows() diff --git a/test/trim_entrypoint.jl b/test/trim_entrypoint.jl index ae07d9e..ab4e1e6 100644 --- a/test/trim_entrypoint.jl +++ b/test/trim_entrypoint.jl @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# JuliaC `--trim=safe` workload for ArrowCore and ArrowStrings (compiled and +# JuliaC `--trim=safe` workload for ArrowCore and DataStrings (compiled and # executed by test/trim_compile_tests.jl, following the trim harness convention # from JSON/HTTP/Reseau/StructUtils). Everything reachable from `main` must be # free of dynamic dispatch: this file is the executable definition of the @@ -27,9 +27,9 @@ const AC = ArrowCore # The C data interface is part of the trim-safe surface: a trimmed binary # that moves columns across the C seams is the canonical embedding use. include(joinpath(@__DIR__, "..", "src", "cdata.jl")) -include(joinpath(@__DIR__, "..", "src", "ArrowStrings", "src", "ArrowStrings.jl")) -using .ArrowStrings -const AS = ArrowStrings +include(joinpath(@__DIR__, "..", "src", "DataStrings", "src", "DataStrings.jl")) +using .DataStrings +const AS = DataStrings function checked(cond::Bool, msg::String)::Nothing cond || error(msg) @@ -276,28 +276,28 @@ function exercise_arrowstrings()::Nothing viewed = Vector{UInt8}(codeunits("a much longer value")) p1 = AS.inline_payload(inline, 1, 4) p2 = AS.view_payload(viewed, 1, length(viewed), 0, 0) - present = StringVector{ArrowString}([p1, p2], Vector{UInt8}[viewed]) - checked(present[1] == "abcd", "ArrowStrings inline access failed") - checked(present[2] == "a much longer value", "ArrowStrings view access failed") - checked(isless(present[1], "z"), "ArrowStrings comparison failed") + present = StringVector{DataString}([p1, p2], Vector{UInt8}[viewed]) + checked(present[1] == "abcd", "DataStrings inline access failed") + checked(present[2] == "a much longer value", "DataStrings view access failed") + checked(isless(present[1], "z"), "DataStrings comparison failed") materialized = AS.materialize(present) checked( materialized isa Vector{String} && materialized == ["abcd", "a much longer value"], - "ArrowStrings materialize failed", + "DataStrings materialize failed", ) - nullable = StringVector{Union{Missing,ArrowString}}( + nullable = StringVector{Union{Missing,DataString}}( [p1, AS.PAYLOAD_MISSING, p2], Vector{UInt8}[viewed], ) - checked(nullable[2] === missing, "ArrowStrings missing access failed") + checked(nullable[2] === missing, "DataStrings missing access failed") nullable_materialized = AS.materialize(nullable) checked( nullable_materialized isa Vector{Union{String,Missing}} && isequal( nullable_materialized, Union{String,Missing}["abcd", missing, "a much longer value"], ), - "ArrowStrings nullable materialize failed", + "DataStrings nullable materialize failed", ) return nothing end
