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

Method Init

cpp/src/arrow/compute/kernels/aggregate_basic.cc:826–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824 }
825
826 static Result<std::unique_ptr<KernelState>> Init(KernelContext* ctx,
827 const KernelInitArgs& args) {
828 if (!args.options) {
829 return Status::Invalid("Must provide IndexOptions for index kernel");
830 }
831 const auto& options = static_cast<const IndexOptions&>(*args.options);
832 if (!options.value) {
833 return Status::Invalid("Must provide IndexOptions.value for index kernel");
834 } else if (!options.value->type->Equals(*args.inputs[0].type)) {
835 return Status::TypeError("Expected IndexOptions.value to be of type ",
836 *args.inputs[0].type, ", but got ", *options.value->type);
837 }
838 IndexInit visitor(ctx, options, *args.inputs[0].type);
839 return visitor.Create();
840 }
841};
842
843} // namespace

Callers

nothing calls this directly

Calls 4

InvalidFunction · 0.50
TypeErrorFunction · 0.50
EqualsMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected