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

Function castVARCHAR_bool_int64

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

Source from the content-addressed store, hash-verified

574}
575
576FORCE_INLINE
577const char* castVARCHAR_bool_int64(gdv_int64 context, gdv_boolean value,
578 gdv_int64 out_len, gdv_int32* out_length) {
579 gdv_int32 len = static_cast<gdv_int32>(out_len);
580 if (len < 0) {
581 gdv_fn_context_set_error_msg(context, "Output buffer length can't be negative");
582 *out_length = 0;
583 return "";
584 }
585 if (value) {
586 *out_length = (len > 4) ? 4 : len;
587 return "true";
588 } else {
589 *out_length = (len > 5) ? 5 : len;
590 return "false";
591 }
592}
593
594// Truncates the string to given length
595#define CAST_VARCHAR_FROM_VARLEN_TYPE(TYPE) \

Callers 1

TESTFunction · 0.85

Calls 1

Tested by 1

TESTFunction · 0.68