-
Notifications
You must be signed in to change notification settings - Fork 109
feat(arrow/array): Add new arreflect package #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
549bc80
feat(arreflect): add arrow/arreflect package for Go↔Arrow reflection
zeroshade 429120e
fix(arreflect): address code review findings from roborev #849
zeroshade 12e024f
fix(arreflect): use reflect.Value.Equal for REE run detection on comp…
zeroshade e2a7e66
fix(arreflect): complete temporal-tag write path and add roundtrip tests
zeroshade 00494ba
fix(arreflect): use value-equality for pointer-typed REE elements
zeroshade 56c19db
fix(arreflect): use time-of-day for Time32/Time64 encoding, fix int32…
zeroshade ddae670
refactor(arreflect): extract timeOfDayNanos helper, strengthen time t…
zeroshade b6f76d9
test(arreflect): fix vacuous time32 millisecond precision assertion
zeroshade 3174a11
fix(arreflect): propagate dict/ree/listview tags in struct schema, mi…
zeroshade d2b2613
fix(arreflect): REE test, listview error on bad type, time64 second c…
zeroshade 45e8575
fix(arreflect): ree struct field error, dead code cleanup, UTC normal…
zeroshade c6e6292
refactor(arreflect): replace v.Interface().(T) with reflect.TypeAsser…
zeroshade f4b3c66
refactor(arreflect): rename public API, standardize errors, update docs
zeroshade 3485a4a
refactor(arreflect): eliminate code duplication (-89 lines)
zeroshade 4068ba7
fix(arreflect): TypeAssert ok check, deduplicate error prefixes, API …
zeroshade 4b116ce
refactor(arreflect): eliminate code smells per roborev #868
zeroshade 29a94c4
fix(arreflect): wire sentinel errors and fix list-view error label
zeroshade bb2882c
feat(arreflect): add GoTypeOf, GetAny, ToAnySlice for runtime type in…
zeroshade 765f03b
feat(arreflect): API polish — renames, options, nil allocator, RecordAt
zeroshade d7f8fa4
fix(arreflect): sentinel classification, MAP inference, rune safety, …
zeroshade 39d7944
feat(arreflect): API fixes, options expansion, duplication cleanup
zeroshade 86d41a8
refactor(arreflect): address review findings, reduce duplication, add…
zeroshade 079eb28
fix(arreflect): guard test reflect.Value, add list builder default, p…
zeroshade 1b3cdb7
test(arreflect): convert to testify, add godoc examples and struct-ar…
zeroshade debea62
fix(arreflect): prevent panics in InferGoType and nil []byte inconsis…
zeroshade 37fe93e
fix(arreflect): address review findings from jobs 892-894
zeroshade bf6d5a3
fix(arreflect): guard WithListView dispatch, deref ptr in empty-slice…
zeroshade 40ad519
fix(arreflect): validate InferGoType field names, remove dead REE bra…
zeroshade 2682e33
fix(arreflect): use rune not byte for identifier check, use buildArra…
zeroshade 7abf9d9
fix(arreflect): correct REE append order, match Dict/REE priority, ad…
zeroshade 8f712e4
fix(arreflect): guard FixedSizeList type mismatch, reject unsupported…
zeroshade 19b6a48
fix(arreflect): correct empty-slice ListView element type, validate D…
zeroshade 3b9d97f
fix(arreflect): remove BOOL from dict value whitelist, add bool dict …
zeroshade 2f2bfd4
fix(arreflect): remove dead REE appendValue case, add int/uint and ta…
zeroshade dc839f4
fix(arreflect): validate full field name as Go identifier, guard dict…
zeroshade 937e043
fix(arreflect): thread opts through buildRunEndEncodedArray, use chec…
zeroshade 4f62a23
fix(arreflect): remove dead typeOfDuration from buildArray and buildT…
zeroshade 4fbb131
fix(arreflect): clear ListView in REE valOpts, add REE+temporal test
zeroshade 2162e38
fix(arreflect): checked listAppender assertion, multi-ptr deref in li…
zeroshade 38926fb
fix(arreflect): error on non-slice after ptr deref in list builder, a…
zeroshade ed35ef8
fix(arreflect): place nil-pointer list tests in correct test functions
zeroshade 2dfb040
fix(arreflect): nil FixedSizeList appends null, multi-level ptr deref…
zeroshade c9cd4ee
test(arreflect): add nil FixedSizeList and pointer dict test coverage
zeroshade 5bf7158
test(arreflect): remove dead var, add dict dedup assertion and multi-…
zeroshade 4f8cc07
test(arreflect): add dict dedup assertion to multi-level pointer test
zeroshade 33ed82d
fix(arreflect): drop dead inferListElemDT return, validate WithTempor…
zeroshade 034a9dd
refactor(arreflect): move package from arrow/arreflect to arrow/array…
zeroshade a7d7773
test(arreflect): add WithTemporal non-time type test, note timestamp …
zeroshade ab4e790
fix(arreflect): full multi-level ptr deref in all builder loops, add …
zeroshade 768935b
test(arreflect): strengthen multi-level ptr assertions, add map/fixed…
zeroshade c4867d7
refactor(arreflect): consolidate duplication, extract helpers, fix de…
zeroshade 790e3d0
fix(arreflect): restore outer-element index in fixed-size list error …
zeroshade 3abfcb1
refactor(arreflect): second-pass consolidation — helpers, iterSlice c…
zeroshade 39ccd63
fix(arreflect): increment idx counter on null path in fixed-size list…
zeroshade 30cad48
refactor(arreflect): third-pass consolidation — eliminate appendPrimi…
zeroshade 2e35ae5
refactor(arreflect): final cleanup — extract buildEmptyTyped, delete …
zeroshade 095a046
refactor(arreflect): remove dead opts tagOpts parameter from appendValue
zeroshade 4bb3fd9
fix(arreflect): address Copilot review findings on PR #771
zeroshade 29f8ebe
test(arreflect): expand coverage of error paths and uncovered branches
zeroshade 49018a5
fix(arreflect): address review findings from job 363
zeroshade 50d1eb4
generalize ParseErr
zeroshade 9ea66db
feat(arreflect): add Large field to tagOpts, parse large tag, add Wit…
zeroshade a291252
feat(arreflect): add applyLargeOpts and hasLargeableType
zeroshade 7d810f5
feat(arreflect): thread large through inferStructType and applyEncodi…
zeroshade 1c7ef89
feat(arreflect): thread large opts through builder functions
zeroshade 90efaf4
fix(arreflect): silence unused opts param in buildDictionaryArray
zeroshade 6d1be8d
fix(arreflect): thread opts into buildFixedSizeListArray and document…
zeroshade 615de8e
feat(arreflect): validate large option at entrypoints
zeroshade 11b3eff
docs(arreflect): add WithLarge and large struct tag examples
zeroshade 6674bb9
test(arreflect): add WithLarge round-trip tests
zeroshade 9d69407
fix(arreflect): produce LARGE_LIST_VIEW in buildEmptyTyped when Large…
zeroshade 266fb4c
test(arreflect): add StringView/BinaryView builder and unknown-tag pu…
zeroshade 62df451
feat(arreflect): rename ListView→View in tagOpts, token, and WithList…
zeroshade e2a7f28
feat(arreflect): add applyViewOpts and hasViewableType
zeroshade 2ca6425
feat(arreflect): thread view through inferStructType, applyEncodingOp…
zeroshade cdb5172
fix(arreflect): remove stale large_listview_empty duplicate, fold ass…
zeroshade e44aa8f
feat(arreflect): thread view opts through builder functions
zeroshade b721749
fix(arreflect): LARGE_STRING/BINARY→STRING_VIEW/BINARY_VIEW in applyV…
zeroshade 96dee20
feat(arreflect): WithView round-trip tests, fix WithListView→WithView…
zeroshade e573f55
fix(arreflect): fix truncated doc comment; rename stale WithListView …
zeroshade d976f08
fix(arreflect): hasViewableType accepts LARGE_STRING/BINARY; add larg…
zeroshade c8ba88e
fix(arreflect): hasViewableType accepts all view/large-list/view-type…
zeroshade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // Package arreflect provides utilities for converting between | ||
| // Apache Arrow arrays and Go structs using reflection. | ||
| // | ||
| // The primary entry points are the generic functions [At], [ToSlice], | ||
| // [FromSlice], [RecordToSlice], and [RecordFromSlice], which convert | ||
| // between Arrow arrays/records and Go slices of structs. | ||
| // | ||
| // Schema inference is available via [InferSchema] and [InferType]. | ||
| // | ||
| // Arrow struct tags control field mapping: | ||
| // | ||
| // type MyRow struct { | ||
| // Name string `arrow:"name"` | ||
| // Score float64 `arrow:"score"` | ||
| // Skip string `arrow:"-"` | ||
| // Enc string `arrow:"enc,dict"` | ||
| // T32 time.Time `arrow:"t32,time32"` | ||
| // } | ||
| // | ||
| // Temporal type overrides for time.Time fields: | ||
| // | ||
| // arrow:"field,date32" — use Date32 instead of Timestamp | ||
| // arrow:"field,date64" — use Date64 instead of Timestamp | ||
| // arrow:"field,time32" — use Time32(ms) instead of Timestamp | ||
| // arrow:"field,time64" — use Time64(ns) instead of Timestamp | ||
| // | ||
| // Additional tag options: | ||
| // | ||
| // arrow:"field,view" — use STRING_VIEW/BINARY_VIEW for string/bytes fields, or LIST_VIEW for slice fields | ||
| // arrow:"field,ree" — run-end encoding at top-level only (struct fields not supported) | ||
| // arrow:"field,decimal(precision,scale)" — override decimal precision and scale (e.g., arrow:",decimal(18,2)") | ||
| package arreflect | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.