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

Function chr_int32

cpp/src/gandiva/precompiled/string_ops.cc:1392–1405  ·  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

1390// Returns the ASCII character having the binary equivalent to A.
1391// If A is larger than 256 the result is equivalent to chr(A % 256).
1392FORCE_INLINE
1393const char* chr_int32(gdv_int64 context, gdv_int32 in, gdv_int32* out_len) {
1394 in = in % 256;
1395 *out_len = 1;
1396
1397 char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len));
1398 if (ret == nullptr) {
1399 gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string");
1400 *out_len = 0;
1401 return "";
1402 }
1403 ret[0] = char(in);
1404 return ret;
1405}
1406
1407// Returns the ASCII character having the binary equivalent to A.
1408// 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