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

Function CreateFunctionContext

be/src/exprs/iceberg-functions-test.cc:37–48  ·  view source on GitHub ↗

Create a FunctionContext for tests that doesn't allocate memory through a mem pool.

Source from the content-addressed store, hash-verified

35
36// Create a FunctionContext for tests that doesn't allocate memory through a mem pool.
37FunctionContext* CreateFunctionContext(
38 MemPool* pool) {
39 FunctionContext::TypeDesc return_type;
40 return_type.type = FunctionContext::Type::TYPE_INT;
41 FunctionContext::TypeDesc param_desc;
42 param_desc.type = FunctionContext::Type::TYPE_INT;
43 std::vector<FunctionContext::TypeDesc> arg_types(2, param_desc);
44 FunctionContext* ctx = FunctionContextImpl::CreateContext(
45 nullptr, pool, pool, return_type, arg_types, 0, true);
46 EXPECT_TRUE(ctx != nullptr);
47 return ctx;
48}
49
50// Create a FunctionContext where the used mem pool comes as a parameter. Can be used
51// for tests that allocate memory through mem pool, e.g. truncate strings tests.

Callers 6

TestStringMethod · 0.85
TestBinaryMethod · 0.85
TestDecimalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected