Commits

Wes McKinney authored f0ed8e23435
ARROW-8922: [C++] Add illustrative "ascii_upper" and "ascii_length" scalar string functions valid for Array and Scalar inputs There's some new code generation machinery here (that will be worth ongoing iteration) but the relevant implementation / "developer UX" is what's in string_scalar_ascii.cc, take a look. Note: the implementation of `ascii_upper` is far from optimal. `std::toupper` does more than convert ASCII to uppercase and so it would likely be faster to replace it with a bespoke implementation that only deals with the ASCII alphabetic character space ``` In [1]: import pyarrow as pa; import pyarrow.compute as pc In [2]: arr = pa.array(['aaa', 'bbbbbb', None, '']) In [3]: pc.ascii_upper(arr) Out[3]: <pyarrow.lib.StringArray object at 0x7f7044003e50> [ "AAA", "BBBBBB", null, "" ] In [4]: pc.ascii_length(arr) Out[4]: <pyarrow.lib.Int32Array object at 0x7f7044003910> [ 3, 6, null, 0 ] ``` int64 offsets are respected with LargeString ``` In [5]: arr = pa.array(['aaa', 'bbbbbb', None, ''], type='large_utf8') In [6]: pc.ascii_length(arr) Out[6]: <pyarrow.lib.Int64Array object at 0x7f703c74cbb0> [ 3, 6, null, 0 ] ``` Closes #7278 from wesm/ARROW-8922 Authored-by: Wes McKinney <wesm+git@apache.org> Signed-off-by: Wes McKinney <wesm+git@apache.org>