lidavidm commented on code in PR #214:
URL: https://github.com/apache/arrow-nanoarrow/pull/214#discussion_r1223448564
##########
extensions/nanoarrow_ipc/src/nanoarrow/nanoarrow_ipc_decoder.c:
##########
@@ -1297,6 +1299,143 @@ static struct ArrowIpcBufferFactory
ArrowIpcBufferFactoryFromShared(
return out;
}
+// Just for the purposes of endian-swapping (not data access)
+struct ArrowIpcDecimal128 {
+ uint64_t words[2];
+};
+
+struct ArrowIpcDecimal256 {
+ uint64_t words[4];
+};
+
+struct ArrowIpcMonthsDays {
+ uint32_t months;
+ uint32_t days;
+};
+
+struct ArrowIpcIntervalMonthDayNano {
+ union {
+ uint64_t force_align_uint64;
+ struct ArrowIpcMonthsDays months_days;
+ };
+ uint64_t ns;
+};
+
+static int ArrowIpcDecoderSwapEndian(struct ArrowIpcBufferSource* src,
+ struct ArrowBufferView* out_view,
+ struct ArrowBuffer* dst, struct
ArrowError* error) {
+ // Some buffer data types don't need any endian swapping
+ switch (src->data_type) {
+ case NANOARROW_TYPE_BOOL:
+ case NANOARROW_TYPE_INT8:
+ case NANOARROW_TYPE_UINT8:
+ case NANOARROW_TYPE_STRING:
Review Comment:
Ah, sounds good.
--
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]