singhpratech opened a new pull request, #226:
URL: https://github.com/apache/arrow-swift/pull/226

   ## What's Changed
   
   Adds the null type, which until now was only a case in `ArrowTypeId`.
   
   - `ArrowType.ArrowNull`, with C data interface format string `n` in both 
directions.
   - `NullArray` (`ArrowArray<Never>`) and `NullArrayBuilder` / 
`NullBufferBuilder`, available through 
`ArrowArrayBuilders.loadNullArrayBuilder()` and `loadBuilder(arrowType:)`. A 
null array has no buffers, so the builder only tracks its length; 
`ArrowData.isNull` returns `true` for the null type without touching a buffer.
   - IPC: the reader maps the flatbuffers `Null` type and loads a null column 
from its field node alone, consuming no buffers. The writer emits the `Null` 
type and no buffers. `ChunkedArrayHolder` reports zero buffers for a null 
column instead of assuming two or three.
   - C data interface: a null array exports with `n_buffers == 0` and imports 
back with its length.
   
   Not included: `ArrowEncoder` / `ArrowDecoder`, since there is no Swift value 
type that maps to a null column.
   
   ## Testing
   
   - `testNullArray`: builder and array behaviour, including through 
`ArrowArrayHolderBuilder`.
   - `testNullTypeInMemoryToFromStream`: round trip through the streaming and 
file formats, with the null column placed between an int32 and a string column 
so that a wrong buffer count would corrupt the column after it.
   - `testImportExportNullArray` and a null field added to 
`testImportExportSchema`.
   - `swift test` passes locally on macOS with Swift 6.3 and the 
`-warnings-as-errors` flags enabled.
   - Checked by hand against pyarrow 21.0.0 in both directions: pyarrow reads 
the stream and file written by Swift as `[int32, null, string]` with the 
expected values, and Swift reads a file with the same columns written by 
pyarrow.
   
   Closes #225.


-- 
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