[]ValueNormalizer RegisterValueNormalizer adds a hook consulted by normalizeDriverValue before the binary encoders dispatch on the value's type. Intended for use from init() in importers that own driver-specific value types — duckdbservice registers a normalizer that converts duckdb.Interval and duc
(n ValueNormalizer)
| 23 | // registers a normalizer that converts duckdb.Interval and duckdb.Decimal to |
| 24 | // their arrowmap equivalents. |
| 25 | func RegisterValueNormalizer(n ValueNormalizer) { |
| 26 | if n == nil { |
| 27 | return |
| 28 | } |
| 29 | cur, _ := driverNormalizers.Load().([]ValueNormalizer) |
| 30 | next := make([]ValueNormalizer, 0, len(cur)+1) |
| 31 | next = append(next, cur...) |
| 32 | next = append(next, n) |
| 33 | driverNormalizers.Store(next) |
| 34 | } |
| 35 | |
| 36 | // normalizeDriverValue runs every registered ValueNormalizer over the value. |
| 37 | // Each normalizer returns the input unchanged when it doesn't claim it; the |