LemonCondor opened a new pull request, #1687:
URL: https://github.com/apache/arrow-go/pull/1687

   ### Rationale for this change
   
   The `database/sql` driver converts each result value with `fromArrowType`, 
and any Arrow type missing from its switch makes `rows.Next` fail with `type 
*array.Uint32: not supported`. This happens for:
   
   - unsigned integers (`uint8`, `uint16`, `uint32`, `uint64`), even though the 
driver already accepts Go unsigned integers as query parameters 
(`toArrowDataType` / `setFieldValue`), so a value bound as `uint32` cannot be 
read back;
   - `large_utf8` and `large_binary`, reported in apache/arrow#43403 (closed 
without a fix; its PR apache/arrow#43402 was withdrawn when ADBC was suggested 
as an alternative);
   - `string_view` and `binary_view`, which some engines (for example 
DataFusion) produce for string columns.
   
   A query that returns any column of these types fails as soon as the first 
row is read, so none of the rows can be used, not only that column.
   
   ### What changes are included in this PR?
   
   `fromArrowType` returns the Go value of these arrays, in the same way as the 
types it already handles: `uint8`/`uint16`/`uint32`/`uint64` keep their width 
(no overflow for values above `math.MaxInt64`), the string types return 
`string` and the binary types return `[]byte`, like `utf8` and `binary`.
   
   ### Are these changes tested?
   
   Yes. `TestFromArrowTypeUnsignedAndLargeTypes` converts a value and a null 
for each of the eight types. Without the change, every non-null case fails with 
`ErrNotSupported`. With the change, they all pass.
   
   Ran locally: `go test ./arrow/flight/flightsql/driver/` (whole package, 
including the in-process server tests) and `go vet 
./arrow/flight/flightsql/driver/`. I did not run golangci-lint.
   
   ### Are there any user-facing changes?
   
   Yes. Results with these column types can now be read through the `flightsql` 
`database/sql` driver instead of failing.
   
   This change was written with AI assistance: an AI coding assistant wrote the 
code, the test and this description.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to