paleolimbot commented on code in PR #248:
URL: https://github.com/apache/arrow-adbc/pull/248#discussion_r1050320039
##########
c/driver/sqlite/statement_reader.c:
##########
@@ -517,12 +517,14 @@ AdbcStatusCode StatementReaderInferFinalize(
sqlite3_stmt* stmt, int num_columns, int64_t num_rows, struct
StatementReader* reader,
struct ArrowBitmap* validity, struct ArrowBuffer* data, struct
ArrowBuffer* binary,
enum ArrowType* current_type, struct AdbcError* error) {
- CHECK_NA(INTERNAL, ArrowSchemaInit(&reader->schema, NANOARROW_TYPE_STRUCT),
error);
+ ArrowSchemaInit(&reader->schema);
+ CHECK_NA(INTERNAL, ArrowSchemaSetType(&reader->schema,
NANOARROW_TYPE_STRUCT), error);
CHECK_NA(INTERNAL, ArrowSchemaAllocateChildren(&reader->schema,
num_columns), error);
Review Comment:
This is fine, but the pattern I envisioned was "`Init` once on the parent,
`Set` children". For struct arrays you can do `ArrowSetTypeStruct(schema,
num_children)` (then skip the `ArrowSchemaInit()` on the children).
--
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]