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

Method ToUInt64

be/src/runtime/string-value.cc:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35uint64_t StringValue::ToUInt64() const {
36 unsigned char bytes[8];
37 *((uint64_t*)bytes) = 0;
38 uint32_t len = Len();
39 const char* ptr = Ptr();
40 int chars_to_copy = (len < 8) ? len : 8;
41 for (int i = 0; i < chars_to_copy; i++) {
42 bytes[i] = static_cast<unsigned char>(ptr[i]);
43 }
44 return static_cast<uint64_t>(bytes[0]) << 56 | static_cast<uint64_t>(bytes[1]) << 48
45 | static_cast<uint64_t>(bytes[2]) << 40 | static_cast<uint64_t>(bytes[3]) << 32
46 | static_cast<uint64_t>(bytes[4]) << 24 | static_cast<uint64_t>(bytes[5]) << 16
47 | static_cast<uint64_t>(bytes[6]) << 8 | static_cast<uint64_t>(bytes[7]);
48}
49
50string StringValue::LargestSmallerString() const {
51 uint32_t len = Len();

Callers 3

TestConvertToUInt64ImplFunction · 0.80
ComputeOverlapRatioMethod · 0.80
CheckStringValsFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestConvertToUInt64ImplFunction · 0.64
CheckStringValsFunction · 0.64