MCPcopy Create free account
hub / github.com/apache/impala / Reverse

Method Reverse

be/src/exprs/string-functions-ir.cc:630–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630StringVal StringFunctions::Reverse(FunctionContext* context, const StringVal& str) {
631 if (str.is_null) return StringVal::null();
632 if (context->impl()->GetConstFnAttr(FunctionContextImpl::UTF8_MODE)) {
633 return Utf8Reverse(context, str);
634 }
635 StringVal result(context, str.len);
636 if (UNLIKELY(result.is_null)) return StringVal::null();
637 BitUtil::ByteSwap(result.ptr, str.ptr, str.len);
638 return result;
639}
640
641static inline void InPlaceReverse(uint8_t* ptr, int len) {
642 for (int i = 0, j = len - 1; i < j; ++i, --j) {

Callers

nothing calls this directly

Calls 2

GetConstFnAttrMethod · 0.80
implMethod · 0.80

Tested by

no test coverage detected