| 1030 | } |
| 1031 | |
| 1032 | void AddCopyFunctions() { |
| 1033 | auto registry = GetFunctionRegistry(); |
| 1034 | |
| 1035 | // This function simply copies memory from the input argument into the |
| 1036 | // (preallocated) output |
| 1037 | auto func = std::make_shared<ScalarFunction>("test_copy", Arity::Unary(), |
| 1038 | /*doc=*/FunctionDoc::Empty()); |
| 1039 | |
| 1040 | // Add a few kernels. Our implementation only accepts arrays |
| 1041 | ASSERT_OK(func->AddKernel({uint8()}, uint8(), ExecCopyArraySpan)); |
| 1042 | ASSERT_OK(func->AddKernel({int32()}, int32(), ExecCopyArraySpan)); |
| 1043 | ASSERT_OK(func->AddKernel({float64()}, float64(), ExecCopyArraySpan)); |
| 1044 | ASSERT_OK(registry->AddFunction(func)); |
| 1045 | |
| 1046 | // A version which doesn't want the executor to call PropagateNulls |
| 1047 | auto func2 = std::make_shared<ScalarFunction>( |
| 1048 | "test_copy_computed_bitmap", Arity::Unary(), /*doc=*/FunctionDoc::Empty()); |
| 1049 | ScalarKernel kernel({uint8()}, uint8(), ExecComputedBitmap); |
| 1050 | kernel.null_handling = NullHandling::COMPUTED_PREALLOCATE; |
| 1051 | ASSERT_OK(func2->AddKernel(kernel)); |
| 1052 | ASSERT_OK(registry->AddFunction(func2)); |
| 1053 | } |
| 1054 | |
| 1055 | void AddNoPreallocateFunctions() { |
| 1056 | auto registry = GetFunctionRegistry(); |
nothing calls this directly
no test coverage detected