MCPcopy Create free account
hub / github.com/apache/arrow / chr_int32

Function chr_int32

cpp/src/gandiva/precompiled/string_ops.cc:1417–1430  ·  view source on GitHub ↗

Returns the ASCII character having the binary equivalent to A. If A is larger than 256 the result is equivalent to chr(A % 256).

Source from the content-addressed store, hash-verified

1415// Returns the ASCII character having the binary equivalent to A.
1416// If A is larger than 256 the result is equivalent to chr(A % 256).
1417FORCE_INLINE
1418const char* chr_int32(gdv_int64 context, gdv_int32 in, gdv_int32* out_len) {
1419 in = in % 256;
1420 *out_len = 1;
1421
1422 char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len));
1423 if (ret == nullptr) {
1424 gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string");
1425 *out_len = 0;
1426 return "";
1427 }
1428 ret[0] = char(in);
1429 return ret;
1430}
1431
1432// Returns the ASCII character having the binary equivalent to A.
1433// If A is larger than 256 the result is equivalent to chr(A % 256).

Callers 1

TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68