In the all-in-one binary, duckdbservice's init() registers a normalizer that converts duckdb.Interval / duckdb.Decimal to arrowmap.IntervalValue / arrowmap.DecimalValue before encode*Funcs dispatch. We can't import duckdbservice from a server test (import cycle), so register the same hook here so Te
()
| 19 | // duckdbservice from a server test (import cycle), so register the same |
| 20 | // hook here so TestEncodeNumeric / TestEncodeInterval keep working. |
| 21 | func init() { |
| 22 | RegisterValueNormalizer(func(v any) any { |
| 23 | switch x := v.(type) { |
| 24 | case duckdb.Interval: |
| 25 | return arrowmap.IntervalValue{Months: x.Months, Days: x.Days, Micros: x.Micros} |
| 26 | case duckdb.Decimal: |
| 27 | return arrowmap.DecimalValue{Value: x.Value, Scale: int(x.Scale)} |
| 28 | } |
| 29 | return v |
| 30 | }) |
| 31 | } |
| 32 | |
| 33 | func TestMapDuckDBType(t *testing.T) { |
| 34 | tests := []struct { |
nothing calls this directly
no test coverage detected