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

Method FromExpressions

cpp/src/arrow/dataset/scanner.cc:827–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827Result<ProjectionDescr> ProjectionDescr::FromExpressions(
828 std::vector<compute::Expression> exprs, std::vector<std::string> names,
829 const Schema& dataset_schema) {
830 compute::MakeStructOptions project_options{std::move(names)};
831
832 for (size_t i = 0; i < exprs.size(); ++i) {
833 if (auto ref = exprs[i].field_ref()) {
834 // set metadata and nullability for plain field references
835 ARROW_ASSIGN_OR_RAISE(auto field, ref->GetOne(dataset_schema));
836 project_options.field_nullability[i] = field->nullable();
837 project_options.field_metadata[i] = field->metadata();
838 }
839 }
840
841 return ProjectionDescr::FromStructExpression(
842 call("make_struct", std::move(exprs), std::move(project_options)), dataset_schema);
843}
844
845Result<ProjectionDescr> ProjectionDescr::FromNames(std::vector<std::string> names,
846 const Schema& dataset_schema,

Callers

nothing calls this directly

Calls 5

field_refMethod · 0.80
nullableMethod · 0.80
callFunction · 0.50
sizeMethod · 0.45
metadataMethod · 0.45

Tested by

no test coverage detected