apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.43k stars 3.51k forks source link

[C++] Add casting option to set unsafe casts to null rather than some garbage value #17509

Open asfimport opened 7 years ago

asfimport commented 7 years ago

Null is the obvious choice when certain casts fail, like string to number, but in other kinds of unsafe casts there may be more ambiguity.

Reporter: Wes McKinney / @wesm

Related issues:

Note: This issue was originally created as ARROW-1489. Please see the migration documentation for further details.

asfimport commented 4 years ago

Wes McKinney / @wesm: This might yield some code bloat but would still be useful to have in our repertoire

asfimport commented 3 years ago

David Li / @lidavidm: Additionally it seems right now, even with unsafe cast enabled, a failed string-to-float cast always raises an ArrowInvalid (it may make sense to have an option to allow filling a null or nan or some other value instead).

asfimport commented 3 years ago

Wes McKinney / @wesm: Right, we might start with just the string-to-float "problem" — it probably just means generating some array functions (with new names – e.g. more specifically, like "string_to_double") that do the errors-as-null behavior.