paleolimbot / nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
4 stars 0 forks source link

User-friendly schema constructors #10

Closed paleolimbot closed 2 years ago

paleolimbot commented 2 years ago

To allocate a schema of a given type, one can do something like this:

struct ArrowSchema schema;
ArrowSchemaInit(schema, NANOARROW_TYPE_INT32);

For parameterized types, this is split into multiple calls, which is maybe slow (but is anybody doing this in a tight loop?)

struct ArrowSchema schema;
ArrowSchemaInit(schema, NANOARROW_TYPE_FIZED_SIZE_BINARY);
ArrowSchemaSetFixedSize(schema, 42);
paleolimbot commented 2 years ago

Yes - I didn't quite get there Friday afternoon. I'm on vacation this week but look forward to picking this back up on Monday!

codecov-commenter commented 2 years ago

Codecov Report

Merging #10 (025097e) into main (3cb6063) will decrease coverage by 1.42%. The diff coverage is 86.50%.

@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
- Coverage   93.40%   91.97%   -1.43%     
==========================================
  Files           5        5              
  Lines         637      798     +161     
  Branches       21       30       +9     
==========================================
+ Hits          595      734     +139     
- Misses         27       41      +14     
- Partials       15       23       +8     
Impacted Files Coverage Δ
src/nanoarrow/schema.c 79.07% <86.50%> (+9.65%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3cb6063...025097e. Read the comment docs.