You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "eddelbuettel (via GitHub)" <gi...@apache.org> on 2024/09/06 15:06:54 UTC

[I] Allow non-nullable schemas to be created [arrow-nanoarrow]

eddelbuettel opened a new issue, #604:
URL: https://github.com/apache/arrow-nanoarrow/issues/604

   We commonly use a combination of columns that are non-nullable and nullable.  The current default of 'always nullable' from e.g. line 179 here is a little strict.
   
   https://github.com/apache/arrow-nanoarrow/blob/75ef830c80b0edcbd3604eb013497e1792dfca69/src/nanoarrow/common/schema.c#L175-L185
   
   Obviously, we can add a local variant with an added bool which calls this and then, as needed, follows up with
   
        schema->flags &= ~ARROW_FLAG_NULLABLE;
   
   But can you see a way to more cleanly allow this?  There are a few spots that condition / undo but they seem like lower-level entry points.  If I am missing something really obvious don't be shy and call me out  :grinning: 


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Allow non-nullable schemas to be created [arrow-nanoarrow]

Posted by "eddelbuettel (via GitHub)" <gi...@apache.org>.
eddelbuettel commented on issue #604:
URL: https://github.com/apache/arrow-nanoarrow/issues/604#issuecomment-2334395172

   Yep -- I actually like a simple pair of `ArrowSchemaSetNullability()` and  `ArrowSchemaIUnsetNullability()` (or maybe even just the latter if the default is to set). 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Allow non-nullable schemas to be created [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #604:
URL: https://github.com/apache/arrow-nanoarrow/issues/604#issuecomment-2334366601

   That is a great point...it was this way initially due to the `ArrowSchema`'s role as both "data type" and "field" (which is data type + name + nullability in most Arrow implementations). Having this be nullable by default is a bit safer since some implementations use the nulability flag to skip checking for nulls and it would result in incorrect behaviour to set that by default.
   
   > Obviously, we can add a local variant with an added bool which calls this and then, as needed, follows up with
   
   This is probably your best bet for now, but it would be cheap to add `ArrowSchemaSetNullability()` (or maybe more generically, `ArrowSchemaSetFlag(schema, flag, state)`) for better readability when toggling the flag.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Allow non-nullable schemas to be created [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub) via issues" <is...@arrow.apache.org>.
paleolimbot closed issue #604: Allow non-nullable schemas to be created
URL: https://github.com/apache/arrow-nanoarrow/issues/604


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org