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

Function chr_int64

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

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).
1409FORCE_INLINE
1410const char* chr_int64(gdv_int64 context, gdv_int64 in, gdv_int32* out_len) {
1411 in = in % 256;
1412 *out_len = 1;
1413
1414 char* ret = reinterpret_cast<char*>(gdv_fn_context_arena_malloc(context, *out_len));
1415 if (ret == nullptr) {
1416 gdv_fn_context_set_error_msg(context, "Could not allocate memory for output string");
1417 *out_len = 0;
1418 return "";
1419 }
1420 ret[0] = char(in);
1421 return ret;
1422}
1423
1424FORCE_INLINE
1425const char* convert_fromUTF8_binary(gdv_int64 context, const char* bin_in, gdv_int32 len,

Callers 1

TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68